mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-02-26 00:09:11 +00:00
rewrite version func
This commit is contained in:
parent
5057029267
commit
229bc4a15f
@ -79,14 +79,15 @@ func main() {
|
||||
}),
|
||||
kong.Vars{
|
||||
"version": func() string {
|
||||
if version == "" {
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return "(unable to read build info)"
|
||||
}
|
||||
version = strings.Split(info.Main.Version, "-")[0]
|
||||
if version != "" {
|
||||
return version
|
||||
}
|
||||
return version
|
||||
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return "(unable to read version)"
|
||||
}
|
||||
return strings.Split(info.Main.Version, "-")[0]
|
||||
}(),
|
||||
},
|
||||
)
|
||||
|
||||
@ -77,14 +77,15 @@ func main() {
|
||||
}),
|
||||
kong.Vars{
|
||||
"version": func() string {
|
||||
if version == "" {
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return "(unable to read build info)"
|
||||
}
|
||||
version = strings.Split(info.Main.Version, "-")[0]
|
||||
if version != "" {
|
||||
return version
|
||||
}
|
||||
return version
|
||||
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return "(unable to read version)"
|
||||
}
|
||||
return strings.Split(info.Main.Version, "-")[0]
|
||||
}(),
|
||||
},
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user