Skip to content

Commit

Permalink
command/build: Much improved artifact output
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jun 8, 2013
1 parent a0664c7 commit 8641215
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions command/build/command.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package build

import (
"bytes"
"flag"
"fmt"
"github.com/mitchellh/packer/packer"
Expand Down Expand Up @@ -189,13 +190,16 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Output all the artifacts
env.Ui().Say("\n==> The build completed! The artifacts created were:")
for name, artifact := range artifacts {
env.Ui().Say(fmt.Sprintf("--> %s:", name))
var message bytes.Buffer
fmt.Fprintf(&message, "--> %s: ", name)

if artifact != nil {
env.Ui().Say(artifact.String())
fmt.Fprintf(&message, artifact.String())
} else {
env.Ui().Say("<nothing>")
fmt.Print("<nothing>")
}

env.Ui().Say(message.String())
}

return 0
Expand Down

0 comments on commit 8641215

Please sign in to comment.