Skip to content

Commit

Permalink
fix(worker,engine): return 1 when command not found (#5851)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux authored Jun 18, 2021
1 parent 095de77 commit 2c22655
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion engine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ func init() {
}

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

var mainCmd = &cobra.Command{
Expand Down
8 changes: 7 additions & 1 deletion engine/worker/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package main

import (
"os"
)

func main() {
cmd := cmdMain()
cmd.AddCommand(cmdExport)
Expand All @@ -22,5 +26,7 @@ func main() {
// last command: doc, this command is hidden
cmd.AddCommand(cmdDoc(cmd))

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

0 comments on commit 2c22655

Please sign in to comment.