Commit 05e61e1a authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

command/build: output warnings

parent 9acaa97a
......@@ -113,12 +113,20 @@ func (c Command) Run(env packer.Environment, args []string) int {
log.Printf("Preparing build: %s", b.Name())
b.SetDebug(cfgDebug)
b.SetForce(cfgForce)
// TODO(mitchellh): Handle warnings
_, err := b.Prepare(userVars)
warnings, err := b.Prepare(userVars)
if err != nil {
env.Ui().Error(err.Error())
return 1
}
if len(warnings) > 0 {
ui := buildUis[b.Name()]
ui.Say(fmt.Sprintf("Warnings for build '%s':\n", b.Name()))
for _, warning := range warnings {
ui.Say(fmt.Sprintf("* %s", warning))
}
ui.Say("")
}
}
// Run all the builds in parallel and wait for them to complete
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment