mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
feat: Suppress color for all hooks if PRE_COMMIT_COLOR=never set (#409)
This commit is contained in:
parent
d4902313ce
commit
b12f0c662c
15 changed files with 78 additions and 11 deletions
|
|
@ -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=$?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue