mirror of
https://github.com/onyx-and-iris/exclude.git
synced 2026-04-16 14:13:39 +00:00
move versionFromBuild
This commit is contained in:
12
main.go
12
main.go
@@ -12,12 +12,6 @@ import (
|
||||
|
||||
var version string // Version of the CLI, set during build time
|
||||
|
||||
func main() {
|
||||
if err := fang.Execute(context.Background(), cmd.RootCmd, fang.WithVersion(versionFromBuild())); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func versionFromBuild() string {
|
||||
if version != "" {
|
||||
return version
|
||||
@@ -29,3 +23,9 @@ func versionFromBuild() string {
|
||||
}
|
||||
return strings.Split(info.Main.Version, "-")[0]
|
||||
}
|
||||
|
||||
func main() {
|
||||
if err := fang.Execute(context.Background(), cmd.RootCmd, fang.WithVersion(versionFromBuild())); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user