Skip to content

Commit

Permalink
Return Exit Code 1 on Failure
Browse files Browse the repository at this point in the history
Previously, the code returned exit code 0 even when the template
generation failed. Now, if an error occurs, the program will return
exit code 1.
  • Loading branch information
gcs278 committed Jul 25, 2024
1 parent 1aac18e commit 6efd2d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ func main() {
cmd.Flags().StringVar(&args.OutputMode, "output-mode", "single", "Output mode to generate a single file or one file per group ('group' or 'single')")
cmd.Flags().IntVar(&args.MaxDepth, "max-depth", 10, "Maximum recursion level for type discovery")

cmd.Execute()
if err := cmd.Execute(); err != nil {
os.Exit(1)
}
}

func doRun(_ *cobra.Command, _ []string) error {
Expand Down

0 comments on commit 6efd2d0

Please sign in to comment.