correct behavior of profile add to yes flag

This commit is contained in:
Christian Goll
2023-02-01 10:56:51 +01:00
parent cb1726bd40
commit 0042edf994

View File

@@ -38,10 +38,6 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
if !SetYes {
// The checks run twice in the prompt case.
// Avoiding putting in a blocking prompt in an API.
err = apiprofile.AddProfile(&set, false)
if err != nil {
return
}
_, _, err = apiprofile.ProfileSetParameterCheck(&set, false)
if err != nil {
return
@@ -52,5 +48,5 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
return
}
}
return apiprofile.ProfileSet(&set)
return apiprofile.AddProfile(&set, false)
}