Skip to content

Commit

Permalink
Suppress terraform init color
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxymVlasov committed Jul 6, 2022
1 parent c86a8a4 commit 0c29584
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hooks/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ function common::terraform_init {
local exit_code=0
local init_output

# Suppress terraform init color
if [ "$PRE_COMMIT_COLOR" = "never" ]; then
TF_INIT_ARGS+=("-no-color")
fi

if [ ! -d .terraform ]; then
init_output=$(terraform init -backend=false "${TF_INIT_ARGS[@]}" 2>&1)
exit_code=$?
Expand Down

0 comments on commit 0c29584

Please sign in to comment.