require confirmation before wavedash publish - #54
Conversation
Publishing makes a build live for players, so gate it behind the same confirmation `clear-playtest-data` uses: an interactive cliclack prompt that defaults to No, `-y` / `--yes` / `--force` to skip it, and a refusal when stdin is not a terminal (or CI is set) and there is no prompt to answer. Note this makes `-y` mandatory for scripted/agent publishes, which is the point — an unattended run can no longer make a build live by accident. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Claude finished @The64thRealm's task in 3m 56s —— View job Code reviewThe gate itself is correct and faithfully mirrors the One inline comment posted. Everything below is smaller. NitsNo test pins the new CLI surface. Declining exits 0. src/publish.rs:138-141 returns Warning goes to stdout, prompt goes to stderr. On the breaking change
Not verifiedI could not compile:
|
| #[arg( | ||
| long = "yes", | ||
| short = 'y', | ||
| visible_alias = "force", | ||
| help = "Skip confirmation (required when non-interactive)" | ||
| )] | ||
| yes: bool, |
There was a problem hiding this comment.
Flag naming is inverted relative to clear-playtest-data, and --force is now overloaded three ways.
clear-playtest-data (src/main.rs:218-224) declares long = "force", short = 'y', visible_alias = "yes"; this declares the mirror image. Both accept all three spellings, so nothing breaks — but the help output disagrees:
wavedash clear-playtest-data --help→-y, --force [aliases: yes]wavedash publish --help→-y, --yes [aliases: force]
Separately, --force already means something different elsewhere in the CLI: on stat delete (src/main.rs:365) and achievement delete (src/main.rs:463) it means "proceed even though user progress is attached", not "skip the confirmation prompt" — and neither of those exposes -y. Making --force a visible alias here pushes a third meaning into the same word.
--yes reads better for publish (it isn't destructive, just consequential), so I'd keep it canonical and demote the alias to a hidden one — compatibility for anyone who reaches for --force out of habit, without advertising the overloaded name:
| #[arg( | |
| long = "yes", | |
| short = 'y', | |
| visible_alias = "force", | |
| help = "Skip confirmation (required when non-interactive)" | |
| )] | |
| yes: bool, | |
| #[arg( | |
| long = "yes", | |
| short = 'y', | |
| alias = "force", | |
| help = "Skip confirmation (required when non-interactive)" | |
| )] | |
| yes: bool, |
Flipping clear-playtest-data to match is the other reasonable direction — the point is that the two confirmation gates should read the same way.
|
niceee thank you! |
Publishing makes a build live for players, so gate it behind the same confirmation
clear-playtest-datauses: an interactive cliclack prompt that defaults to No,-y/--yes/--forceto skip it, and a refusal when stdin is not a terminal (or CI is set) and there is no prompt to answer.Note this makes
-ymandatory for scripted/agent publishes, which is the point — an unattended run can no longer make a build live by accident.