mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-24 14:45:39 +00:00
Fixed no-colors regression #2218
This commit is contained in:
parent
f76815959a
commit
e204677ff8
@ -71,6 +71,10 @@ yq -P -oy sample.json
|
||||
level := logging.WARNING
|
||||
stringFormat := `[%{level}] %{color}%{time:15:04:05}%{color:reset} %{message}`
|
||||
|
||||
// when NO_COLOR environment variable presents and not an empty string the coloured output should be disabled;
|
||||
// refer to no-color.org
|
||||
forceNoColor = forceNoColor || os.Getenv("NO_COLOR") != ""
|
||||
|
||||
if verbose && forceNoColor {
|
||||
level = logging.DEBUG
|
||||
stringFormat = `[%{level:5.5s}] %{time:15:04:05} %{shortfile:-33s} %{shortfunc:-25s} %{message}`
|
||||
@ -90,10 +94,6 @@ yq -P -oy sample.json
|
||||
logging.SetBackend(backend)
|
||||
yqlib.InitExpressionParser()
|
||||
|
||||
// when NO_COLOR environment variable presents and not an empty string the coloured output should be disabled;
|
||||
// refer to no-color.org
|
||||
forceNoColor = os.Getenv("NO_COLOR") != ""
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user