commands: Do not show empty BuildDate in version - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit 4eedb377b60fb6742c97398942a0045ff2a824c4
DIR parent b2b500f563c3bb36751a4c1610df113c4daad604
HTML Author: Anthony Fok <foka@debian.org>
Date: Thu, 26 Apr 2018 06:35:04 -0600
commands: Do not show empty BuildDate in version
Diffstat:
M commands/version.go | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
DIR 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)
}