mirror of
https://github.com/onyx-and-iris/ignr.git
synced 2025-07-27 06:11:48 +00:00
don't log.Fatal if we can't read version...
This commit is contained in:
parent
cad1585975
commit
f4ddb45fd2
9
main.go
9
main.go
@ -3,7 +3,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"strings"
|
"strings"
|
||||||
@ -58,14 +57,6 @@ func init() {
|
|||||||
// main is the entry point of the application.
|
// main is the entry point of the application.
|
||||||
// It executes the root command and handles any errors.
|
// It executes the root command and handles any errors.
|
||||||
func main() {
|
func main() {
|
||||||
if version == "" {
|
|
||||||
info, ok := debug.ReadBuildInfo()
|
|
||||||
if !ok {
|
|
||||||
log.Fatal("could not read build info")
|
|
||||||
}
|
|
||||||
version = strings.Split(info.Main.Version, "-")[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := fang.Execute(context.Background(), rootCmd, fang.WithVersion(versionFromBuild())); err != nil {
|
if err := fang.Execute(context.Background(), rootCmd, fang.WithVersion(versionFromBuild())); err != nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user