Disable color if the output stream is not a terminal; Fixes #4
This commit is contained in:
parent
a9197527a2
commit
5772eba1cb
1 changed files with 11 additions and 9 deletions
4
mk.go
4
mk.go
|
|
@ -10,10 +10,12 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
"github.com/mattn/go-isatty"
|
||||||
)
|
)
|
||||||
|
|
||||||
// True if messages should be printed without fancy colors.
|
// True if messages should be printed without fancy colors.
|
||||||
var nocolor bool = false
|
// - By default, if the output stream is not the terminal, colors are disabled
|
||||||
|
var nocolor bool = !isatty.IsTerminal(os.Stdout.Fd())
|
||||||
|
|
||||||
// True if we are ignoring timestamps and rebuilding everything.
|
// True if we are ignoring timestamps and rebuilding everything.
|
||||||
var rebuildall bool = false
|
var rebuildall bool = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue