Skip to content

Commit

Permalink
feat: Adding init to terraform_tflint hook (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-glenn committed Apr 13, 2022
1 parent ac54720 commit 1aff30f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hooks/terraform_tflint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {
Expand Down

0 comments on commit 1aff30f

Please sign in to comment.