File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2
2
package main
3
3
4
4
import (
5
+ "os"
6
+
5
7
"github.com/charmbracelet/log"
6
8
"github.com/sailpoint-oss/sailpoint-cli/cmd/root"
7
9
"github.com/sailpoint-oss/sailpoint-cli/internal/config"
@@ -23,9 +25,15 @@ func init() {
23
25
// goes wrong. This will exit the cli container during pipeline build and fail that stage.
24
26
func main () {
25
27
26
- _ = rootCmd .Execute ()
28
+ err : = rootCmd .Execute ()
27
29
28
30
if saveErr := config .SaveConfig (); saveErr != nil {
29
31
log .Warn ("Issue saving config file" , "error" , saveErr )
30
32
}
33
+
34
+ // When error occurs, we need to make sure we exit the program with an error code. We
35
+ // don't need to log it here because the sub commands already log it to the console.
36
+ if err != nil {
37
+ os .Exit (1 )
38
+ }
31
39
}
You can’t perform that action at this time.
0 commit comments