Skip to content

Commit

Permalink
[DEX-94] fix(cmd) application remove - add check if app exists
Browse files Browse the repository at this point in the history
  • Loading branch information
clemfromspace committed Jul 15, 2022
1 parent 136412f commit 2b9f80e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cmd/application/remove/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ func NewRemoveCmd(f *cmdutil.Factory, runF func(*RemoveOptions) error) *cobra.Co

// runRemoveCmd executes the remove command
func runRemoveCmd(opts *RemoveOptions) error {
_, err := opts.config.Application.GetID()
if err != nil {
return fmt.Errorf("unable to find application %s", opts.config.Application.Name)
}

if opts.DoConfirm {
var confirmed bool
err := prompt.Confirm(fmt.Sprintf("Are you sure you want to remove the application %q?", opts.config.Application.Name), &confirmed)
Expand All @@ -75,7 +80,7 @@ func runRemoveCmd(opts *RemoveOptions) error {
}
}

err := opts.config.Application.Remove()
err = opts.config.Application.Remove()
if err != nil {
return err
}
Expand Down

0 comments on commit 2b9f80e

Please # to comment.