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
20
mk.go
20
mk.go
|
|
@ -1,19 +1,21 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bufio"
|
||||
"runtime"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"github.com/mattn/go-isatty"
|
||||
)
|
||||
|
||||
// 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.
|
||||
var rebuildall bool = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue