From f90c3a289b34a0c8324de7aedb3a6a798eaaa2ec Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Sun, 30 Aug 2020 20:18:15 +0200 Subject: [PATCH] Check if report output folder exists before listing --- lib/linter.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index cb20fe0f..b724327e 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1070,9 +1070,13 @@ Reports() { ############################################# # Print info on reports that were generated # ############################################# - info "Contents of report folder:" - OUTPUT_CONTENTS_CMD=$(ls "${REPORT_OUTPUT_FOLDER}") - info "$OUTPUT_CONTENTS_CMD" + if [ -d "${REPORT_OUTPUT_FOLDER}" ]; then + info "Contents of report folder:" + OUTPUT_CONTENTS_CMD=$(ls "${REPORT_OUTPUT_FOLDER}") + info "$OUTPUT_CONTENTS_CMD" + else + warn "Report output folder (${REPORT_OUTPUT_FOLDER}) does NOT exist." + fi fi ################################