Ensure we fail during deploys

If an error gets emitted during a deployment, we should fail.
This also reenables colors that seems to have gotten lost somewhere.
This commit is contained in:
joeduffy 2017-09-09 12:42:04 -07:00
parent f75b465052
commit f74e9e04bd
2 changed files with 6 additions and 2 deletions

View file

@ -108,9 +108,11 @@ func (eng *Engine) deployLatest(info *envCmdInfo, opts deployOptions) error {
_ = eng.Environment.SaveEnvironment(targ, summary.Snap())
fmt.Fprint(eng.Stdout, colors.Colorize(&footer))
if err != nil {
return err
}
}
}
if !eng.Diag().Success() {
// If any error that wasn't printed above, be sure to make it evident in the output.
return goerr.New("One or more errors occurred during this deployment")

View file

@ -21,7 +21,9 @@ type Engine struct {
func (e *Engine) Diag() diag.Sink {
if e.snk == nil {
e.InitDiag(diag.FormatOptions{})
e.InitDiag(diag.FormatOptions{
Colors: true,
})
}
return e.snk