diff options
-rw-r--r-- | common/hugo/hugo.go | 2 | ||||
-rw-r--r-- | common/hugo/version.go | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/common/hugo/hugo.go b/common/hugo/hugo.go index d78564a67..54fbd65a3 100644 --- a/common/hugo/hugo.go +++ b/common/hugo/hugo.go @@ -38,6 +38,8 @@ const ( ) var ( + // buildDate allows vendor-specified build date when .git/ is unavailable. + buildDate string // vendorInfo contains vendor notes about the current build. vendorInfo string ) diff --git a/common/hugo/version.go b/common/hugo/version.go index edcb983d7..3bb6472e2 100644 --- a/common/hugo/version.go +++ b/common/hugo/version.go @@ -154,6 +154,10 @@ func BuildVersionString() string { date := bi.RevisionTime if date == "" { + // Accept vendor-specified build date if .git/ is unavailable. + date = buildDate + } + if date == "" { date = "unknown" } |