mirror of
https://github.com/onyx-and-iris/exclude.git
synced 2026-03-30 23:19:09 +00:00
move versionFromBuild
This commit is contained in:
parent
aa6c6a0fd3
commit
f1312fb781
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)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user