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
|
|
@ -15,6 +15,11 @@ function main {
|
|||
common::parse_cmdline "$@"
|
||||
common::export_provided_env_vars "${ENVS[@]}"
|
||||
common::parse_and_export_env_vars
|
||||
|
||||
# Suppress terraform validate color
|
||||
if [ "$PRE_COMMIT_COLOR" = "never" ]; then
|
||||
ARGS+=("-no-color")
|
||||
fi
|
||||
# shellcheck disable=SC2153 # False positive
|
||||
common::per_dir_hook "${ARGS[*]}" "$HOOK_ID" "${FILES[@]}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue