fix: added os.Exit in commands with error
This commit is contained in:
parent
2b9e3d66d2
commit
4ff8094988
2 changed files with 2 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ var fetchCmd = &cobra.Command{
|
||||||
// check if we actually have any targets to run
|
// check if we actually have any targets to run
|
||||||
if len(targets) <= 0 {
|
if len(targets) <= 0 {
|
||||||
log.Error().Msg("must specify a target")
|
log.Error().Msg("must specify a target")
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check to see if an access token is available from env
|
// check to see if an access token is available from env
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ var serveCmd = &cobra.Command{
|
||||||
b, err := json.MarshalIndent(conf, "", "\t")
|
b, err := json.MarshalIndent(conf, "", "\t")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("failed to marshal config")
|
log.Error().Err(err).Msg("failed to marshal config")
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
fmt.Printf("%v\n", string(b))
|
fmt.Printf("%v\n", string(b))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue