From 79b8b5bd89a158f86434417e31c07fade5d17aa6 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Wed, 22 Jan 2020 15:36:22 -0600 Subject: [PATCH] Guarded against empty file list --- assets/common.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/assets/common.sh b/assets/common.sh index 9ffecc3..c84cbc2 100644 --- a/assets/common.sh +++ b/assets/common.sh @@ -27,12 +27,14 @@ load_files() { # TODO: Remove Me - DEBUGGING echo "Files:" echo $files - for fileName in "$files"; do - local jq_path=".source.files.${fileName}" - local content=$(jq -r "${jq_path}" < $1) - echo "$content" > "/tmp/${fileName}" - # TODO: Remove Me - DEBUGGING - echo "File /tmp/${fileName}" - cat /tmp/${fileName} - done + if [[ ! -z "${files}" ]]; then + for fileName in $files; do + local jq_path=".source.files.${fileName}" + local content=$(jq -r "${jq_path}" < $1) + echo "$content" > "/tmp/${fileName}" + # TODO: Remove Me - DEBUGGING + echo "File /tmp/${fileName}" + cat /tmp/${fileName} + done + fi } \ No newline at end of file