File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ yq -P -oy sample.json
7171 level := logging .WARNING
7272 stringFormat := `[%{level}] %{color}%{time:15:04:05}%{color:reset} %{message}`
7373
74+ // when NO_COLOR environment variable presents and not an empty string the coloured output should be disabled;
75+ // refer to no-color.org
76+ forceNoColor = forceNoColor || os .Getenv ("NO_COLOR" ) != ""
77+
7478 if verbose && forceNoColor {
7579 level = logging .DEBUG
7680 stringFormat = `[%{level:5.5s}] %{time:15:04:05} %{shortfile:-33s} %{shortfunc:-25s} %{message}`
@@ -90,10 +94,6 @@ yq -P -oy sample.json
9094 logging .SetBackend (backend )
9195 yqlib .InitExpressionParser ()
9296
93- // when NO_COLOR environment variable presents and not an empty string the coloured output should be disabled;
94- // refer to no-color.org
95- forceNoColor = os .Getenv ("NO_COLOR" ) != ""
96-
9797 return nil
9898 },
9999 }
You can’t perform that action at this time.
0 commit comments