Skip to content

Commit

Permalink
Accept vendor-specified build date if .git/ is unavailable
Browse files Browse the repository at this point in the history
Fixes #10053
  • Loading branch information
anthonyfok authored and bep committed Jun 28, 2022
1 parent 2414819 commit 8ebcaa5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/hugo/hugo.go
Expand Up @@ -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
)
Expand Down
4 changes: 4 additions & 0 deletions common/hugo/version.go
Expand Up @@ -153,6 +153,10 @@ func BuildVersionString() string {
osArch := bi.GoOS + "/" + bi.GoArch

date := bi.RevisionTime
if date == "" {
// Accept vendor-specified build date if .git/ is unavailable.
date = buildDate
}
if date == "" {
date = "unknown"
}
Expand Down

0 comments on commit 8ebcaa5

Please sign in to comment.