From 08eaf1861b381fe0206bad64f0227cc73a58ddfc Mon Sep 17 00:00:00 2001 From: Rishikesh Nair Date: Thu, 29 Feb 2024 16:56:32 +0530 Subject: [PATCH] Rename `RAW_OUTPUT` -> `NO_COLOR` Also, if NO_COLOR is empty, output will be colored, otherwise not colored. Signed-off-by: Rishikesh Nair (cherry picked from commit ce0765c9f8e8eec9419449a304811ed6786271d9) Signed-off-by: Brad Davidson --- contrib/util/check-config.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/contrib/util/check-config.sh b/contrib/util/check-config.sh index f70435a8e2..9571f96f18 100755 --- a/contrib/util/check-config.sh +++ b/contrib/util/check-config.sh @@ -21,9 +21,6 @@ binDir=$(dirname "$0") configFormat=gz isError=0 -# RAW_OUTPUT=1 disables colored outputs -RAW_OUTPUT=${RAW_OUTPUT:-0} - if [ $# -gt 0 ]; then CONFIG="$1" fi @@ -58,6 +55,10 @@ is_set_as_module() { } color() { + if [[ -n "$NO_COLOR" ]]; then + return + fi + codes= if [ "$1" = 'bold' ]; then codes=1 @@ -84,11 +85,6 @@ color() { printf '\033['"$codes"'m' } wrap_color() { - if [ $RAW_OUTPUT -eq 1 ]; then - echo -n "$1" - return - fi - text="$1" shift color "$@"