display version correctly
This commit is contained in:
parent
56d73a5b83
commit
f0e83beaaa
|
@ -40,7 +40,7 @@ func (c *VersionCommand) Run(args []string) int {
|
||||||
var versionString bytes.Buffer
|
var versionString bytes.Buffer
|
||||||
fmt.Fprintf(&versionString, "Packer v%s", c.Version)
|
fmt.Fprintf(&versionString, "Packer v%s", c.Version)
|
||||||
if c.VersionPrerelease != "" {
|
if c.VersionPrerelease != "" {
|
||||||
fmt.Fprintf(&versionString, ".%s", c.VersionPrerelease)
|
fmt.Fprintf(&versionString, "-%s", c.VersionPrerelease)
|
||||||
|
|
||||||
if c.Revision != "" {
|
if c.Revision != "" {
|
||||||
fmt.Fprintf(&versionString, " (%s)", c.Revision)
|
fmt.Fprintf(&versionString, " (%s)", c.Revision)
|
||||||
|
|
|
@ -20,7 +20,7 @@ func FormattedVersion() string {
|
||||||
var versionString bytes.Buffer
|
var versionString bytes.Buffer
|
||||||
fmt.Fprintf(&versionString, "%s", Version)
|
fmt.Fprintf(&versionString, "%s", Version)
|
||||||
if VersionPrerelease != "" {
|
if VersionPrerelease != "" {
|
||||||
fmt.Fprintf(&versionString, ".%s", VersionPrerelease)
|
fmt.Fprintf(&versionString, "-%s", VersionPrerelease)
|
||||||
|
|
||||||
if GitCommit != "" {
|
if GitCommit != "" {
|
||||||
fmt.Fprintf(&versionString, " (%s)", GitCommit)
|
fmt.Fprintf(&versionString, " (%s)", GitCommit)
|
||||||
|
|
Loading…
Reference in New Issue