Skip to content

Commit

Permalink
capture errors from cmd/root
Browse files Browse the repository at this point in the history
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
  • Loading branch information
mkcp committed Sep 13, 2024
1 parent 4e7b638 commit 9f99493
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ var rootCmd = &cobra.Command{
SilenceErrors: true,
Run: func(cmd *cobra.Command, args []string) {
zarfLogo := message.GetLogo()
_, _ = fmt.Fprintln(os.Stderr, zarfLogo)
cmd.Help()
_, _ = fmt.Fprintln(os.Stderr, zarfLogo) //nolint:errcheck
err := cmd.Help()
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, err) //nolint:errcheck
}

if len(args) > 0 {
if strings.Contains(args[0], config.ZarfPackagePrefix) || strings.Contains(args[0], "zarf-init") {
Expand Down

0 comments on commit 9f99493

Please sign in to comment.