Make dry-run release previews skip stdin prompts unless explicitly requested. - Add a release prompt gate that suppresses version prompts for default dry-runs and honors --interactive as an opt-in. - Update release CLI usage text and argument parsing for dry-run interactivity. - Cover dry-run, --yes, real-release, and release.mjs ordering behavior with script tests. Files changed: scripts/__tests__/release-prompt-gate.test.mjs | 72 ++++++++++++++++++++++++++ scripts/lib/release-prompt-gate.mjs | 13 +++++ scripts/release.mjs | 16 ++++-- 3 files changed, 97 insertions(+), 4 deletions(-) Fusion-Task-Id: FN-6472 Fusion-Task-Lineage: 07bfd944-f4a0-454a-883f-dadf1aa0b7d4
14 lines
737 B
JavaScript
14 lines
737 B
JavaScript
/**
|
|
* FNXC:ReleaseScript 2026-06-14-23:08:
|
|
* Dry-run releases must be non-interactive by default because FN-6469 showed non-TTY agent shells can hang on unsettled top-level await and exit 13 when the version prompt reads stdin.
|
|
* `--interactive` is the explicit dry-run opt-in for maintainers who intentionally want to exercise the version prompt; real releases keep prompting unless `--yes` is passed.
|
|
*
|
|
* @param {{ dryRun: boolean, autoYes: boolean, interactive: boolean }} options
|
|
* @returns {boolean} true when the release script should prompt for a version override.
|
|
*/
|
|
export function shouldPromptForVersion({ dryRun, autoYes, interactive }) {
|
|
if (autoYes) return false;
|
|
if (dryRun) return interactive;
|
|
return true;
|
|
}
|