From 7df1a370b3a6cfdac64fd221cf2da3c4fc2de393 Mon Sep 17 00:00:00 2001 From: Venkat Malladi <venkat.malladi@utsouthwestern.edu> Date: Mon, 23 Mar 2020 17:28:56 -0500 Subject: [PATCH] Check if file exists and not empty. --- workflow/tests/plot_profile.bats | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/workflow/tests/plot_profile.bats b/workflow/tests/plot_profile.bats index 371b80f..d5da39f 100644 --- a/workflow/tests/plot_profile.bats +++ b/workflow/tests/plot_profile.bats @@ -11,8 +11,8 @@ profile_script="./workflow/scripts/plot_profile.sh" source ${profile_script} run compute_matrix test_data/ENCSR238SGC_pooled.fc_signal.bw /project/shared/bicf_workflow_ref/mouse/GRCm38/gencode.vM20.annotation.gtf FILE=computeMatrix.gz - if [[ -f "$FILE" ]]; then - echo "$FILE exist" + if [[ -s "$FILE" ]]; then + echo "$FILE exists and not empty" fi } @@ -20,7 +20,7 @@ profile_script="./workflow/scripts/plot_profile.sh" source ${profile_script} run plot_profile computeMatrix.gz FILE=plotProfile.png - if [[ -f "$FILE" ]]; then - echo "$FILE exist" + if [[ -s "$FILE" ]]; then + echo "$FILE exists and not empty" fi } -- GitLab