Accept vendor-specified build date if .git/ is unavailable - 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 8ebcaa5394dd398c0929addfcd8b9c776820f8f0
DIR parent 241481931f5f5f2803cd4be519936b26d8648dfd
HTML Author: Anthony Fok <foka@debian.org>
Date: Tue, 28 Jun 2022 07:59:03 -0600
Accept vendor-specified build date if .git/ is unavailable
Fixes #10053
Diffstat:
M common/hugo/hugo.go | 2 ++
M common/hugo/version.go | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
---
DIR diff --git 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
)
DIR diff --git 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"
}