Skip to content

Commit

Permalink
fix: disable color output if NO_COLOR env var is set
Browse files Browse the repository at this point in the history
Closes: #37
  • Loading branch information
natesales committed Oct 10, 2022
1 parent 4913c32 commit 2d1da48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ func clearOpts() {
if fileInfo, _ := os.Stdout.Stat(); (fileInfo.Mode() & os.ModeCharDevice) != 0 {
opts.Color = true
}

// Disable color output if NO_COLOR env var is set
if os.Getenv("NO_COLOR") != "" {
log.Debug("NO_COLOR set")
opts.Color = false
}
}

// tlsVersion returns a TLS version number by given protocol string
Expand Down

0 comments on commit 2d1da48

Please sign in to comment.