Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Fok <foka@debian.org>2018-04-26 15:35:04 +0300
committerAnthony Fok <foka@debian.org>2018-05-14 09:08:12 +0300
commit4eedb377b60fb6742c97398942a0045ff2a824c4 (patch)
treead96f363dfc38031e1ed5a9c69c5af1bdf5836c9 /commands
parentb2b500f563c3bb36751a4c1610df113c4daad604 (diff)
commands: Do not show empty BuildDate in version
Diffstat (limited to 'commands')
-rw-r--r--commands/version.go6
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)
}