File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -12,22 +12,26 @@ import (
12
12
)
13
13
14
14
func main () {
15
+ os .Exit (run ())
16
+ }
17
+
18
+ func run () int {
15
19
ctx := clictx .From (context .Background ())
16
20
17
21
cmd := ignitecmd .New ()
18
22
19
23
// Load plugins if any
20
24
if err := ignitecmd .LoadPlugins (ctx , cmd ); err != nil {
21
25
fmt .Printf ("Error while loading chain's plugins: %v\n " , err )
22
- os . Exit ( 1 )
26
+ return 1
23
27
}
24
28
defer ignitecmd .UnloadPlugins ()
25
29
26
30
err := cmd .ExecuteContext (ctx )
27
31
28
32
if ctx .Err () == context .Canceled || err == context .Canceled {
29
33
fmt .Println ("aborted" )
30
- return
34
+ return 0
31
35
}
32
36
33
37
if err != nil {
@@ -38,7 +42,7 @@ func main() {
38
42
} else {
39
43
fmt .Println (err )
40
44
}
41
-
42
- os .Exit (1 )
45
+ return 1
43
46
}
47
+ return 0
44
48
}
You can’t perform that action at this time.
0 commit comments