Move colorable statements to fix Windows support. (#4287)

This puts it in the main command level.

Fixes #4070
This commit is contained in:
Jeff Mitchell
2018-04-05 13:28:02 -04:00
committed by GitHub
parent 059493b587
commit f361b57fa4
2 changed files with 4 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ import (
"text/tabwriter"
"github.com/hashicorp/vault/command/token"
colorable "github.com/mattn/go-colorable"
"github.com/mitchellh/cli"
"golang.org/x/crypto/ssh/terminal"
)
@@ -99,10 +100,10 @@ func RunCustom(args []string, runOpts *RunOptions) int {
runOpts = &RunOptions{}
}
if runOpts.Stdout == nil {
runOpts.Stdout = os.Stdout
runOpts.Stdout = colorable.NewColorable(os.Stdout)
}
if runOpts.Stderr == nil {
runOpts.Stderr = os.Stderr
runOpts.Stderr = colorable.NewColorable(os.Stderr)
}
args = setupEnv(args)