Skip to content

Commit

Permalink
fix(run): return correct exit code on recipe failure (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
haveiss authored Dec 17, 2024
1 parent 806ecb6 commit 3711fea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,15 @@ func RunCmd() *cobra.Command {
// Print the report
if failures > 0 {
fmt.Println("\nSome recipes were not successful")
err = fmt.Errorf("%d recipes failed", failures)
// Disable usage message on recipe failure
cmd.SilenceUsage = true
} else {
fmt.Println("\nAll recipes ran successful")
}
fmt.Printf("%d failing, %d successful, and %d total\n\n", failures, success, len(recipes))
printer.Table(os.Stdout, report)
return nil
return err
},
}

Expand Down

0 comments on commit 3711fea

Please sign in to comment.