Commit 8f097399 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

command/build: only output artifacts if we have some

parent 47dcd473
...@@ -233,19 +233,20 @@ func (c Command) Run(env packer.Environment, args []string) int { ...@@ -233,19 +233,20 @@ func (c Command) Run(env packer.Environment, args []string) int {
} }
} }
// Output all the artifacts if len(artifacts) > 0 {
env.Ui().Say("\n==> Builds finished. The artifacts of successful builds are:") env.Ui().Say("\n==> Builds finished. The artifacts of successful builds are:")
for name, artifact := range artifacts { for name, artifact := range artifacts {
var message bytes.Buffer var message bytes.Buffer
fmt.Fprintf(&message, "--> %s: ", name) fmt.Fprintf(&message, "--> %s: ", name)
if artifact != nil { if artifact != nil {
fmt.Fprintf(&message, artifact.String()) fmt.Fprintf(&message, artifact.String())
} else { } else {
fmt.Print("<nothing>") fmt.Print("<nothing>")
} }
env.Ui().Say(message.String()) env.Ui().Say(message.String())
}
} }
return 0 return 0
......
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