fix: exit with a non-zero status when a command fails
This commit is contained in:
@@ -12,5 +12,8 @@ func main() {
|
|||||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
|
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
|
||||||
defer stop()
|
defer stop()
|
||||||
|
|
||||||
cmd.RootCmd.ExecuteContext(ctx)
|
if err := cmd.RootCmd.ExecuteContext(ctx); err != nil {
|
||||||
|
stop()
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user