feat: prompt for confirmation on storage:destroy

`storage:destroy` now prompts for confirmation before removing a named storage entry, matching the behavior of other destructive commands such as `apps:destroy` and `network:destroy`. The prompt can be skipped with the `--force` flag or the global `dokku --force` flag for non-interactive callers.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-29 14:31:20 -04:00
parent d003bfaf0e
commit 3493869fa4
6 changed files with 108 additions and 12 deletions

View File

@@ -58,8 +58,9 @@ func main() {
})
case "destroy":
args := flag.NewFlagSet("storage:destroy", flag.ExitOnError)
force := args.Bool("force", false, "--force: force destroy without confirmation")
args.Parse(os.Args[2:])
err = storage.CommandDestroy(args.Arg(0))
err = storage.CommandDestroy(args.Arg(0), *force)
case "ensure-directory":
args := flag.NewFlagSet("storage:ensure-directory", flag.ExitOnError)
chown := args.String("chown", "herokuish", "--chown: chown option (herokuish, heroku, paketo, root, false)")