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 || {