summaryrefslogtreecommitdiffstats
path: root/commands/version.go
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2015-03-18 12:23:13 +0100
committerbep <bjorn.erik.pedersen@gmail.com>2015-03-18 12:23:13 +0100
commit3273fce044f06f90ae296f9b42431958d2b06e7f (patch)
tree4556f7b1c7ffa73d53d3d5d08214999c095868c7 /commands/version.go
parent49f20bbc9bf4eb9ecedfa0fd9dde484256ae91d1 (diff)
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.
Diffstat (limited to 'commands/version.go')
-rw-r--r--commands/version.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/version.go b/commands/version.go
index 88ea941f7..24a900cad 100644
--- a/commands/version.go
+++ b/commands/version.go
@@ -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)
}
},
}