diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9b6f1da --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +all: + go test -coverprofile=c.out -covermode=count diff --git a/cmd/jkl/Makefile b/cmd/jkl/Makefile new file mode 100644 index 0000000..6c86b62 --- /dev/null +++ b/cmd/jkl/Makefile @@ -0,0 +1,3 @@ +all: + go build + go test -coverprofile=c.out -covermode=count diff --git a/cmd/jkl/list.go b/cmd/jkl/list.go index 3f13fc2..14640c8 100644 --- a/cmd/jkl/list.go +++ b/cmd/jkl/list.go @@ -8,6 +8,7 @@ import ( "text/template" "fmt" + "golang.org/x/crypto/ssh/terminal" "otremblay.com/jkl" ) @@ -22,7 +23,7 @@ func init() { type listissue jkl.Issue func (l *listissue) Color() string { - if os.Getenv("JKLNOCOLOR") == "true" { + if os.Getenv("JKLNOCOLOR") == "true" || !terminal.IsTerminal(int(os.Stdout.Fd())) { return "" } if strings.Contains(os.Getenv("RED_ISSUE_STATUSES"), l.Fields.Status.Name) {