6
0
mirror of https://github.com/grdl/git-get.git synced 2026-03-22 19:50:06 +00:00

Add build version metadata to be overridden by ldflags

This commit is contained in:
Grzegorz Dlugoszewski
2020-05-30 13:00:31 +02:00
parent cef21acc9e
commit f9c362a53e

View File

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