Commit 86412155 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

command/build: Much improved artifact output

parent a0664c7e
package build package build
import ( import (
"bytes"
"flag" "flag"
"fmt" "fmt"
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
...@@ -189,13 +190,16 @@ func (c Command) Run(env packer.Environment, args []string) int { ...@@ -189,13 +190,16 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Output all the artifacts // Output all the artifacts
env.Ui().Say("\n==> The build completed! The artifacts created were:") env.Ui().Say("\n==> The build completed! The artifacts created were:")
for name, artifact := range artifacts { for name, artifact := range artifacts {
env.Ui().Say(fmt.Sprintf("--> %s:", name)) var message bytes.Buffer
fmt.Fprintf(&message, "--> %s: ", name)
if artifact != nil { if artifact != nil {
env.Ui().Say(artifact.String()) fmt.Fprintf(&message, artifact.String())
} else { } else {
env.Ui().Say("<nothing>") fmt.Print("<nothing>")
} }
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