fix(cli): require --confirm flag before phases clear deletes directories (#1832)

phases clear now checks for phase dirs before deleting. If any exist and
--confirm is absent, the command exits non-zero with a message showing the
count and how to proceed. Empty phases dir (nothing to delete) succeeds
without --confirm unchanged.

Updates new-milestone.md workflow to pass --confirm (intentional programmatic
caller). Updates existing new-milestone-clear-phases tests to match new API.

Closes #1826

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-05 18:05:32 -04:00
committed by GitHub
parent b185529f48
commit 2ded61bf45
5 changed files with 92 additions and 11 deletions

View File

@@ -602,7 +602,7 @@ async function runCommand(command, args, cwd, raw) {
};
phase.cmdPhasesList(cwd, options, raw);
} else if (subcommand === 'clear') {
milestone.cmdPhasesClear(cwd, raw);
milestone.cmdPhasesClear(cwd, raw, args.slice(2));
} else {
error('Unknown phases subcommand. Available: list, clear');
}