save config change

This commit is contained in:
luke-hagar-sp
2023-02-24 14:00:00 -06:00
parent c3ad87b595
commit 1c0b21592d
6 changed files with 25 additions and 2 deletions

View File

@@ -60,6 +60,11 @@ func NewEnvironmentCommand() *cobra.Command {
fmt.Printf("no environment provided")
}
err = config.SaveConfig()
if err != nil {
return err
}
return nil
},
}

View File

@@ -65,6 +65,11 @@ func newAuthCommand() *cobra.Command {
return fmt.Errorf("invalid selection")
}
err = config.SaveConfig()
if err != nil {
return err
}
return nil
},
}

View File

@@ -29,6 +29,11 @@ func newDebugCommand() *cobra.Command {
viper.Set("debug", false)
}
err = config.SaveConfig()
if err != nil {
return err
}
return nil
},
}

View File

@@ -22,6 +22,11 @@ func newExportTemplateCommand() *cobra.Command {
config.SetCustomExportTemplatePath(args[0])
err = config.SaveConfig()
if err != nil {
return err
}
return nil
},
}

View File

@@ -22,6 +22,11 @@ func newSearchTemplateCommand() *cobra.Command {
config.SetCustomSearchTemplatePath(args[0])
err = config.SaveConfig()
if err != nil {
return err
}
return nil
},
}

View File

@@ -5,7 +5,6 @@ import (
"os"
"github.com/sailpoint-oss/sailpoint-cli/cmd/root"
"github.com/sailpoint-oss/sailpoint-cli/internal/config"
"github.com/spf13/cobra"
)
@@ -21,7 +20,6 @@ func init() {
// goes wrong. This will exit the cli container during pipeline build and fail that stage.
func main() {
err := rootCmd.Execute()
config.SaveConfig()
if err != nil {
os.Exit(1)
}