Merge pull request #3199 from gsd-build/fix/3102-changeset-pr-field

fix(changeset): add missing pr field to windows-npm-shell-fix
This commit is contained in:
Tom Boucher
2026-05-06 21:04:10 -04:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
---
type: Fixed
pr: 3102
---
**Windows update-check no longer silently fails** — `gsd-check-update-worker` now passes `shell: true` only on Windows, allowing `execFileSync('npm', ...)` to resolve `npm.cmd` via PATHEXT. POSIX path (Linux/macOS) is unchanged. Without this fix, the worker failed with ENOENT, `latest` stayed `null`, `update_available` became `null`, and the statusline `⬆ /gsd-update` indicator never rendered for Windows users. Fixes #3103.

View File

@@ -43,6 +43,9 @@ describe('gsd-check-update-worker: Windows npm spawn platform gate', () => {
test('shell option is gated to process.platform === "win32"', () => {
const src = fs.readFileSync(WORKER_PATH, 'utf8');
const codeOnly = src
.replace(/\/\*[\s\S]*?\*\//g, '')
.replace(/(^|[^:])\/\/[^\n]*/g, '$1');
// Locks the platform gate. Allows whitespace/quote variation around
// the comparison so trivial style fixes do not break the contract.
@@ -50,7 +53,7 @@ describe('gsd-check-update-worker: Windows npm spawn platform gate', () => {
/shell:\s*process\.platform\s*===\s*['"]win32['"]/;
assert.match(
src,
codeOnly,
platformGate,
[
'shell option must be `process.platform === "win32"`.',