Skip to content

Commit 9518c70

Browse files
committed
fix: run release npm subprocesses on Windows
1 parent fe50a3e commit 9518c70

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎docs/releasing.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,5 @@ are distribution-only formats — users on those reinstall manually.
182182
`.github/workflows/ci.yml` runs `typecheck` + `test` on pushes to `main` and on
183183
PRs. Both workflows install with `--legacy-peer-deps` (xterm's peer range
184184
conflicts with the installed React major).
185+
186+
On Windows, release subprocesses invoke npm's JavaScript entry through Node to preserve argument boundaries without executing a batch launcher directly.

‎scripts/release.mjs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const capture = args =>
1313

1414
const git = args => execFileSync('git', args, { stdio: 'inherit' })
1515
const npm = args =>
16-
execFileSync(process.platform === 'win32' ? 'npm.cmd' : 'npm', args, {
16+
// Invoke npm's JavaScript entry directly because Windows cannot exec a .cmd file.
17+
execFileSync(process.execPath, [process.env.npm_execpath, ...args], {
1718
// Release verification and `npm version` are deliberately non-interactive.
1819
// Inheriting a shell PTY's stdin lets nested test/git processes participate
1920
// in fish job control and can suspend the entire release with SIGTTIN.

0 commit comments

Comments
 (0)