feat: Suppress color for all hooks if PRE_COMMIT_COLOR=never set (#409)

This commit is contained in:
Maksym Vlasov 2022-07-06 15:34:13 +03:00 committed by Anton Babenko
commit b12f0c662c
15 changed files with 78 additions and 11 deletions

View file

@ -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=$?