6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-05 03:49:42 +00:00

Move the version metadata to cfg packageThis way it can be used by multiple binaries.

This commit is contained in:
Grzegorz Dlugoszewski
2020-06-12 20:56:34 +02:00
parent 33ca245d3a
commit c71ebea2d4
3 changed files with 36 additions and 15 deletions

View File

@@ -13,18 +13,12 @@ import (
"github.com/spf13/viper"
)
var (
version = "dev"
commit = "unknown"
date = "unknown"
)
var cmd = &cobra.Command{
Use: "git-get <repo>",
Short: "git get",
Run: Run,
Args: cobra.MaximumNArgs(1), // TODO: add custom validator
Version: fmt.Sprintf("%s - %s, build at %s", version, commit, date),
Version: cfg.Version(),
}
func init() {