Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: respect NO_COLOR env var
Closes #76
  • Loading branch information
coadler committed Jan 7, 2025
commit 5481c527711782522266bfdcf2bb2b7485e2b547
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