Makefiles with code coverage generation, terminal detection for color strippage
This commit is contained in:
parent
6adb5c4920
commit
5a2f3f98ac
3 changed files with 7 additions and 1 deletions
2
Makefile
Normal file
2
Makefile
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
all:
|
||||||
|
go test -coverprofile=c.out -covermode=count
|
||||||
3
cmd/jkl/Makefile
Normal file
3
cmd/jkl/Makefile
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
all:
|
||||||
|
go build
|
||||||
|
go test -coverprofile=c.out -covermode=count
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"golang.org/x/crypto/ssh/terminal"
|
||||||
"otremblay.com/jkl"
|
"otremblay.com/jkl"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -22,7 +23,7 @@ func init() {
|
||||||
type listissue jkl.Issue
|
type listissue jkl.Issue
|
||||||
|
|
||||||
func (l *listissue) Color() string {
|
func (l *listissue) Color() string {
|
||||||
if os.Getenv("JKLNOCOLOR") == "true" {
|
if os.Getenv("JKLNOCOLOR") == "true" || !terminal.IsTerminal(int(os.Stdout.Fd())) {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
if strings.Contains(os.Getenv("RED_ISSUE_STATUSES"), l.Fields.Status.Name) {
|
if strings.Contains(os.Getenv("RED_ISSUE_STATUSES"), l.Fields.Status.Name) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue