Skip to content

Commit 57cbdf4

Browse files
committed
fix(cdn) rm superfluous model.AssumeYes checks
1 parent df50b39 commit 57cbdf4

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

internal/cmd/beta/cdn/distribution/create/create.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
144144
projectLabel = model.ProjectId
145145
}
146146

147-
if !model.AssumeYes {
148-
prompt := fmt.Sprintf("Are you sure you want to create a CDN distribution for project %q?", projectLabel)
149-
err = params.Printer.PromptForConfirmation(prompt)
150-
if err != nil {
151-
return err
152-
}
147+
prompt := fmt.Sprintf("Are you sure you want to create a CDN distribution for project %q?", projectLabel)
148+
err = params.Printer.PromptForConfirmation(prompt)
149+
if err != nil {
150+
return err
153151
}
154152

155153
req := buildRequest(ctx, model, apiClient)

internal/cmd/beta/cdn/distribution/delete/delete.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
5454
projectLabel = model.ProjectId
5555
}
5656

57-
if !model.AssumeYes {
58-
prompt := fmt.Sprintf("Are you sure you want to delete the CDN distribution %q for project %q?", model.DistributionID, projectLabel)
59-
err = params.Printer.PromptForConfirmation(prompt)
60-
if err != nil {
61-
return err
62-
}
57+
prompt := fmt.Sprintf("Are you sure you want to delete the CDN distribution %q for project %q?", model.DistributionID, projectLabel)
58+
err = params.Printer.PromptForConfirmation(prompt)
59+
if err != nil {
60+
return err
6361
}
6462

6563
// Call API

internal/cmd/beta/cdn/distribution/update/update.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,11 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
117117
params.Printer.Debug(print.ErrorLevel, "get project name: %v", err)
118118
projectLabel = model.ProjectId
119119
}
120-
if !model.AssumeYes {
121-
prompt := fmt.Sprintf("Are you sure you want to update a CDN distribution for project %q?", projectLabel)
122-
err = params.Printer.PromptForConfirmation(prompt)
123-
if err != nil {
124-
return err
125-
}
120+
121+
prompt := fmt.Sprintf("Are you sure you want to update a CDN distribution for project %q?", projectLabel)
122+
err = params.Printer.PromptForConfirmation(prompt)
123+
if err != nil {
124+
return err
126125
}
127126

128127
req := buildRequest(ctx, apiClient, model)

0 commit comments

Comments
 (0)