Skip to content

Commit

Permalink
fixup! Not found error
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
  • Loading branch information
pierre-emmanuelJ committed Jul 19, 2024
1 parent ec93aad commit fb2aab1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/instance_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ func (c *instanceDeleteCmd) cmdRun(_ *cobra.Command, _ []string) error {
for _, i := range c.Instances {
instance, err := instances.FindListInstancesResponseInstances(i)
if err != nil {
fmt.Fprintf(os.Stderr, "warning: %s not found.\n", i)
if !c.Force {
return err
}
fmt.Fprintf(os.Stderr, "warning: %s not found.\n", i)

continue
}
Expand Down Expand Up @@ -88,6 +88,8 @@ func (c *instanceDeleteCmd) cmdRun(_ *cobra.Command, _ []string) error {
return err
}

// Cleaning up resources created in create instance
// https://github.com/exoscale/cli/blob/master/cmd/instance_create.go#L220
for _, i := range instanceToDelete {
instanceDir := path.Join(globalstate.ConfigFolder, "instances", i.String())
if _, err := os.Stat(instanceDir); !os.IsNotExist(err) {
Expand Down

0 comments on commit fb2aab1

Please sign in to comment.