diff options
author | Anthony Fok <foka@debian.org> | 2018-04-26 06:35:04 -0600 |
---|---|---|
committer | Anthony Fok <foka@debian.org> | 2018-05-14 00:08:12 -0600 |
commit | 4eedb377b60fb6742c97398942a0045ff2a824c4 (patch) | |
tree | ad96f363dfc38031e1ed5a9c69c5af1bdf5836c9 /commands/version.go | |
parent | b2b500f563c3bb36751a4c1610df113c4daad604 (diff) |
commands: Do not show empty BuildDate in version
Diffstat (limited to 'commands/version.go')
-rw-r--r-- | commands/version.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/version.go b/commands/version.go index 71ffd625b..dfa79bb69 100644 --- a/commands/version.go +++ b/commands/version.go @@ -45,7 +45,11 @@ func newVersionCmd() *versionCmd { func printHugoVersion() { if hugolib.CommitHash == "" { - jww.FEEDBACK.Printf("Hugo Static Site Generator v%s %s/%s BuildDate: %s\n", helpers.CurrentHugoVersion, runtime.GOOS, runtime.GOARCH, hugolib.BuildDate) + if hugolib.BuildDate == "" { + jww.FEEDBACK.Printf("Hugo Static Site Generator v%s %s/%s\n", helpers.CurrentHugoVersion, runtime.GOOS, runtime.GOARCH) + } else { + jww.FEEDBACK.Printf("Hugo Static Site Generator v%s %s/%s BuildDate: %s\n", helpers.CurrentHugoVersion, runtime.GOOS, runtime.GOARCH, hugolib.BuildDate) + } } else { jww.FEEDBACK.Printf("Hugo Static Site Generator v%s-%s %s/%s BuildDate: %s\n", helpers.CurrentHugoVersion, strings.ToUpper(hugolib.CommitHash), runtime.GOOS, runtime.GOARCH, hugolib.BuildDate) } |