add custom version string
Signed-off-by: Nathan13888 <29968201+Nathan13888@users.noreply.github.com>
This commit is contained in:
parent
f62168a081
commit
c225b0d04f
|
@ -1,6 +1,11 @@
|
|||
package config
|
||||
|
||||
import "runtime"
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
BuildVersion = "development"
|
||||
|
@ -11,3 +16,8 @@ var (
|
|||
GOOS = runtime.GOOS
|
||||
GOARCH = runtime.GOARCH
|
||||
)
|
||||
|
||||
func PrintVersion(cCtx *cli.Context) {
|
||||
fmt.Printf("version=%s buildTime=%s buildUser=%s buildGOOS=%s buildARCH=%s\n",
|
||||
cCtx.App.Version, BuildTime, BuildUser, BuildGOOS, BuildARCH)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue