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:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user