Skip to content

Commit

Permalink
Merge pull request #54 from wxio/windows
Browse files Browse the repository at this point in the history
use colorable *os.File - needs for windows
  • Loading branch information
tj authored Jan 18, 2018
2 parents 17c1d76 + 29fc76b commit a0aa13b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions handlers/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/apex/log"
"github.com/fatih/color"
colorable "github.com/mattn/go-colorable"
)

// Default handler outputting to stderr.
Expand Down Expand Up @@ -47,6 +48,13 @@ type Handler struct {

// New handler.
func New(w io.Writer) *Handler {
switch w2 := w.(type) {
case *os.File:
return &Handler{
Writer: colorable.NewColorable(w2),
Padding: 3,
}
}
return &Handler{
Writer: w,
Padding: 3,
Expand Down

0 comments on commit a0aa13b

Please sign in to comment.