packer: only show git commit in version output for prerelease

This commit is contained in:
Mitchell Hashimoto 2013-07-08 15:38:14 -07:00
parent 45dfcf59c9
commit aef602d0e9
1 changed files with 3 additions and 3 deletions

View File

@ -31,10 +31,10 @@ func (versionCommand) Run(env Environment, args []string) int {
fmt.Fprintf(&versionString, "Packer v%s", Version)
if VersionPrerelease != "" {
fmt.Fprintf(&versionString, ".%s", VersionPrerelease)
}
if GitCommit != "" {
fmt.Fprintf(&versionString, " (%s)", GitCommit)
if GitCommit != "" {
fmt.Fprintf(&versionString, " (%s)", GitCommit)
}
}
env.Ui().Say(versionString.String())