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,10 @@ function main {
|
|||
# Support for setting PATH to repo root.
|
||||
# shellcheck disable=SC2178 # It's the simplest syntax for that case
|
||||
ARGS=${ARGS[*]/__GIT_WORKING_DIR__/$(pwd)\/}
|
||||
# Suppress checkov color
|
||||
if [ "$PRE_COMMIT_COLOR" = "never" ]; then
|
||||
export ANSI_COLORS_DISABLED=true
|
||||
fi
|
||||
# shellcheck disable=SC2128 # It's the simplest syntax for that case
|
||||
common::per_dir_hook "$ARGS" "$HOOK_ID" "${FILES[@]}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue