Skip to content

Commit ecdc428

Browse files
authored
feat: respect NO_COLOR env var (#89)
Closes #76
1 parent ca4d666 commit ecdc428

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cliui/cliui.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var (
5050
func Color(s string) termenv.Color {
5151
colorOnce.Do(func() {
5252
color = termenv.NewOutput(os.Stdout).ColorProfile()
53-
if flag.Lookup("test.v") != nil {
53+
if _, exists := os.LookupEnv("NO_COLOR"); exists || flag.Lookup("test.v") != nil {
5454
// Use a consistent colorless profile in tests so that results
5555
// are deterministic.
5656
color = termenv.Ascii

0 commit comments

Comments
 (0)