Add version stuff on root

This commit is contained in:
Henrique Dias
2017-09-03 10:41:14 +01:00
parent 96a5226076
commit 044575d2af
3 changed files with 28 additions and 10 deletions

View File

@@ -41,7 +41,6 @@ var (
allowNew bool
allowPublish bool
showVer bool
version = "master"
)
func init() {
@@ -102,15 +101,7 @@ func setupViper() {
}
func printVersion() {
version = strings.TrimSpace(version)
if version == "" {
fmt.Println("filemanager is at an untracked version")
} else {
version = strings.TrimPrefix(version, "v")
fmt.Println("filemanager version", version)
}
fmt.Println("filemanager version", filemanager.Version)
os.Exit(0)
}