fix(install): chmod dist/cli.js 0o755 after npm install -g; add regression test (closes #2525) (#2536)

Use process.platform !== 'win32' guard in catch instead of a comment, and add
regression test for bug #2525 (gsd-sdk bin symlink points at non-executable file).

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-21 21:18:34 -04:00
committed by GitHub
parent f32ffc9fb8
commit 8eeaa20791
2 changed files with 83 additions and 1 deletions

View File

@@ -6812,7 +6812,7 @@ function installSdkIfNeeded() {
? path.join(npmPrefix, 'node_modules')
: path.join(npmPrefix, 'lib', 'node_modules');
const cliPath = path.join(globalModulesDir, sdkName, 'dist', 'cli.js');
try { fs.chmodSync(cliPath, 0o755); } catch (e) { /* Windows / path not found */ }
try { fs.chmodSync(cliPath, 0o755); } catch (e) { if (process.platform !== 'win32') throw e; }
}
} catch (e) { /* Non-fatal: PATH verification in step 4 will catch any real failure */ }