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 (
1212)
1313
1414func main () {
15+ os .Exit (run ())
16+ }
17+
18+ func run () int {
1519 ctx := clictx .From (context .Background ())
1620
1721 cmd := ignitecmd .New ()
1822
1923 // Load plugins if any
2024 if err := ignitecmd .LoadPlugins (ctx , cmd ); err != nil {
2125 fmt .Printf ("Error while loading chain's plugins: %v\n " , err )
22- os . Exit ( 1 )
26+ return 1
2327 }
2428 defer ignitecmd .UnloadPlugins ()
2529
2630 err := cmd .ExecuteContext (ctx )
2731
2832 if ctx .Err () == context .Canceled || err == context .Canceled {
2933 fmt .Println ("aborted" )
30- return
34+ return 0
3135 }
3236
3337 if err != nil {
@@ -38,7 +42,7 @@ func main() {
3842 } else {
3943 fmt .Println (err )
4044 }
41-
42- os .Exit (1 )
45+ return 1
4346 }
47+ return 0
4448}
You can’t perform that action at this time.
0 commit comments