Skip to content

Commit

Permalink
Return from runE to run
Browse files Browse the repository at this point in the history
  • Loading branch information
annettejanewilson committed May 31, 2024
1 parent 413ff13 commit eb3cac4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/foreach/foreach.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewForeachCmd() *cobra.Command {
"Make sure to include -- otherwise options will be " +
"interpreted as options for turbolift instead of the " +
"command.",
RunE: runE,
Run: run,
Args: cobra.MinimumNArgs(1),
}

Expand All @@ -61,7 +61,7 @@ func NewForeachCmd() *cobra.Command {
return cmd
}

func runE(c *cobra.Command, args []string) error {
func run(c *cobra.Command, args []string) {
logger := logging.NewLogger(c)

readCampaignActivity := logger.StartActivity("Reading campaign data (%s)", repoFile)
Expand All @@ -70,7 +70,7 @@ func runE(c *cobra.Command, args []string) error {
dir, err := campaign.OpenCampaign(options)
if err != nil {
readCampaignActivity.EndWithFailure(err)
return nil
return
}
readCampaignActivity.EndWithSuccess()

Expand Down Expand Up @@ -108,5 +108,5 @@ func runE(c *cobra.Command, args []string) error {
logger.Warnf("turbolift foreach completed with %s %s(%s, %s, %s)\n", colors.Red("errors"), colors.Normal(), colors.Green(doneCount, " OK"), colors.Yellow(skippedCount, " skipped"), colors.Red(errorCount, " errored"))
}

return nil
return
}

0 comments on commit eb3cac4

Please sign in to comment.