env and config command adjustments

This commit is contained in:
luke-hagar-sp
2023-02-23 13:03:57 -06:00
parent 958bc8dbbd
commit d4cf18c1fb
17 changed files with 87 additions and 19 deletions

View File

@@ -25,6 +25,11 @@ func newCreateCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
var data map[string]interface{}
err := config.InitConfig()
if err != nil {
return err
}
filepath := cmd.Flags().Lookup("file").Value.String()
if filepath != "" {
file, err := os.Open(filepath)
@@ -55,6 +60,7 @@ func newCreateCmd() *cobra.Command {
transform := sailpointsdk.NewTransform(data["name"].(string), data["type"].(string), data["attributes"].(map[string]interface{}))
apiClient := config.InitAPIClient()
transformObj, resp, err := apiClient.V3.TransformsApi.CreateTransform(context.TODO()).Transform(*transform).Execute()
if err != nil {
return sdk.HandleSDKError(resp, err)