From 1aff30f2a4cb0df65a1e693690b5225a112cf621 Mon Sep 17 00:00:00 2001 From: Andrew Glenn <29951057+andrew-glenn@users.noreply.github.com> Date: Wed, 13 Apr 2022 09:15:15 -0500 Subject: [PATCH] feat: Adding init to terraform_tflint hook (#352) --- hooks/terraform_tflint.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hooks/terraform_tflint.sh b/hooks/terraform_tflint.sh index f89ab58bf..6be87da8e 100755 --- a/hooks/terraform_tflint.sh +++ b/hooks/terraform_tflint.sh @@ -34,6 +34,13 @@ function per_dir_hook_unique_part { local -r args="$1" local -r dir_path="$2" + # shellcheck disable=SC2091,SC2068 # Suppress error output + TFLINT_INIT=$(tflint --init 2>&1) 2> /dev/null || { + local exit_code=$? + common:colorify "yellow" "tflint init:" + echo "${TFLINT_INIT}" + return ${exit_code} + } # Print checked PATH **only** if TFLint have any messages # shellcheck disable=SC2091,SC2068 # Suppress error output $(tflint ${args[@]} 2>&1) 2> /dev/null || {