hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 4eedb377b60fb6742c97398942a0045ff2a824c4
parent b2b500f563c3bb36751a4c1610df113c4daad604
Author: Anthony Fok <foka@debian.org>
Date:   Thu, 26 Apr 2018 06:35:04 -0600

commands: Do not show empty BuildDate in version

Diffstat:
Mcommands/version.go | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git 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)
 	}