From 03903488248f9818a6863e836affe18bf584bd65 Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Tue, 31 Jan 2023 10:16:29 +0000 Subject: [PATCH] progress: keep color enabled with NO_COLOR empty The NO_COLOR specification says that color should be disabled if NO_COLOR is set *and not empty*. Signed-off-by: Justin Chadwell --- util/progress/progressui/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/progress/progressui/init.go b/util/progress/progressui/init.go index f21072214825..75f0cb83d1de 100644 --- a/util/progress/progressui/init.go +++ b/util/progress/progressui/init.go @@ -14,7 +14,7 @@ var colorError aec.ANSI func init() { // As recommended on https://no-color.org/ - if _, ok := os.LookupEnv("NO_COLOR"); ok { + if v := os.Getenv("NO_COLOR"); v != "" { // nil values will result in no ANSI color codes being emitted. return } else if runtime.GOOS == "windows" {