shithub: hugo

Download patch

ref: 4eedb377b60fb6742c97398942a0045ff2a824c4
parent: b2b500f563c3bb36751a4c1610df113c4daad604
author: Anthony Fok <[email protected]>
date: Thu Apr 26 02:35:04 EDT 2018

commands: Do not show empty BuildDate in version

--- a/commands/version.go
+++ b/commands/version.go
@@ -45,7 +45,11 @@
 
 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)
 	}