Merge pull request #4525 from mitchellh/nocolorsay

don't show ui color if we're not colorized
This commit is contained in:
Matthew Hooker 2017-02-26 18:47:56 -08:00 committed by GitHub
commit c1480931e2
1 changed files with 7 additions and 4 deletions

View File

@ -92,15 +92,18 @@ func (c BuildCommand) Run(args []string) int {
Color: colors[i%len(colors)],
Ui: ui,
}
if _, ok := c.Ui.(*packer.MachineReadableUi); !ok {
ui.Say(fmt.Sprintf("%s output will be in this color.", b))
if i+1 == len(buildNames) {
// Add a newline between the color output and the actual output
c.Ui.Say("")
}
}
}
buildUis[b] = ui
ui.Say(fmt.Sprintf("%s output will be in this color.", b))
}
// Add a newline between the color output and the actual output
c.Ui.Say("")
log.Printf("Build debug mode: %v", cfgDebug)
log.Printf("Force build: %v", cfgForce)
log.Printf("On error: %v", cfgOnError)