Skip to content

Commit

Permalink
feat: respect NO_COLOR env var (#89)
Browse files Browse the repository at this point in the history
Closes #76
  • Loading branch information
coadler authored Jan 7, 2025
1 parent ca4d666 commit ecdc428
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cliui/cliui.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var (
func Color(s string) termenv.Color {
colorOnce.Do(func() {
color = termenv.NewOutput(os.Stdout).ColorProfile()
if flag.Lookup("test.v") != nil {
if _, exists := os.LookupEnv("NO_COLOR"); exists || flag.Lookup("test.v") != nil {
// Use a consistent colorless profile in tests so that results
// are deterministic.
color = termenv.Ascii
Expand Down

0 comments on commit ecdc428

Please sign in to comment.