mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 06:30:33 +03:00
Refactor Hugo version
Put version handling into the helpers package so it can be used by many, and split version and suffix to make it possible to calculate the next Hugo version.
This commit is contained in:
parent
49f20bbc9b
commit
3273fce044
4 changed files with 64 additions and 6 deletions
|
@ -22,6 +22,7 @@ import (
|
|||
|
||||
"github.com/kardianos/osext"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugolib"
|
||||
)
|
||||
|
||||
|
@ -38,9 +39,9 @@ var version = &cobra.Command{
|
|||
formatBuildDate() // format the compile time
|
||||
}
|
||||
if hugolib.CommitHash == "" {
|
||||
fmt.Printf("Hugo Static Site Generator v%s BuildDate: %s\n", hugolib.Version, hugolib.BuildDate)
|
||||
fmt.Printf("Hugo Static Site Generator v%s BuildDate: %s\n", helpers.HugoVersion(), hugolib.BuildDate)
|
||||
} else {
|
||||
fmt.Printf("Hugo Static Site Generator v%s-%s BuildDate: %s\n", hugolib.Version, strings.ToUpper(hugolib.CommitHash), hugolib.BuildDate)
|
||||
fmt.Printf("Hugo Static Site Generator v%s-%s BuildDate: %s\n", helpers.HugoVersion(), strings.ToUpper(hugolib.CommitHash), hugolib.BuildDate)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue