From 390a2645f281163a04fea78e219eceb00c48addd Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Fri, 15 Oct 2021 22:11:01 +0300 Subject: [PATCH] fix: execute tflint once in no errors (#250) --- terraform_tflint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terraform_tflint.sh b/terraform_tflint.sh index 0473a4a..fbb7bb6 100755 --- a/terraform_tflint.sh +++ b/terraform_tflint.sh @@ -65,8 +65,10 @@ tflint_() { # Print checked PATH **only** if TFLint have any messages # shellcheck disable=SC2091 # Suppress error output - $(tflint "${ARGS[@]}" 2>&1) || - echo >&2 -e "\033[1;31m\nERROR in $path_uniq/:\033[0m" && tflint "${ARGS[@]}" + $(tflint "${ARGS[@]}" 2>&1) || { + echo >&2 -e "\033[1;31m\nERROR in $path_uniq/:\033[0m" + tflint "${ARGS[@]}" + } popd > /dev/null done