Skip to content

Commit

Permalink
ask user if they are ok with proceeding and deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
therealpaulgg committed Feb 21, 2024
1 parent 917b595 commit 3bfffae
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/actions/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@ func Reset(c *cli.Context) error {
return err
}
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("unexpected status code: %d", resp.StatusCode)
fmt.Printf("unexpected status code when attempting to delete machine from endpoint: %d\n Continue with deletion? (y/n): ", resp.StatusCode)
scanner := bufio.NewScanner(os.Stdin)
var answer string
if err := utils.ReadLineFromStdin(scanner, &answer); err != nil {
return err
}
if answer != "y" {
return fmt.Errorf("unexpected status code: %d", resp.StatusCode)
}
}
user, err := user.Current()
if err != nil {
Expand Down

0 comments on commit 3bfffae

Please sign in to comment.