Skip to content

Commit 2c22655

Browse files
authored
fix(worker,engine): return 1 when command not found (#5851)
1 parent 095de77 commit 2c22655

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

engine/main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ func init() {
2323
}
2424

2525
func main() {
26-
mainCmd.Execute()
26+
if err := mainCmd.Execute(); err != nil {
27+
os.Exit(1)
28+
}
2729
}
2830

2931
var mainCmd = &cobra.Command{

engine/worker/main.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package main
22

3+
import (
4+
"os"
5+
)
6+
37
func main() {
48
cmd := cmdMain()
59
cmd.AddCommand(cmdExport)
@@ -22,5 +26,7 @@ func main() {
2226
// last command: doc, this command is hidden
2327
cmd.AddCommand(cmdDoc(cmd))
2428

25-
cmd.Execute()
29+
if err := cmd.Execute(); err != nil {
30+
os.Exit(1)
31+
}
2632
}

0 commit comments

Comments
 (0)