jstar-reviewer 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/jstar.js +7 -8
- package/package.json +1 -1
package/bin/jstar.js
CHANGED
|
@@ -80,21 +80,20 @@ function runScript(scriptName) {
|
|
|
80
80
|
|
|
81
81
|
// Prioritize pnpm if available
|
|
82
82
|
const hasPnpm = commandExists('pnpm');
|
|
83
|
-
|
|
83
|
+
const runner = hasPnpm ? 'pnpm' : 'npx';
|
|
84
84
|
const runnerArgs = hasPnpm ? ['dlx', 'ts-node'] : ['ts-node'];
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
// spawn without shell: true requires the full path or extension on Windows
|
|
88
|
-
if (process.platform === 'win32') {
|
|
89
|
-
runner += '.cmd';
|
|
90
|
-
}
|
|
86
|
+
log(`${COLORS.dim}Using ${runner} to run ${scriptName}...${COLORS.reset}`);
|
|
91
87
|
|
|
92
|
-
|
|
88
|
+
// On Windows, global commands like pnpm/npx are .cmd files.
|
|
89
|
+
// spawn without shell: true often fails with EINVAL or ENOENT on Windows.
|
|
90
|
+
// We use shell: true only on Windows for reliability.
|
|
91
|
+
const isWin = process.platform === 'win32';
|
|
93
92
|
|
|
94
|
-
// Run without shell: true to avoid security warnings
|
|
95
93
|
const child = spawn(runner, [...runnerArgs, scriptPath, ...process.argv.slice(3)], {
|
|
96
94
|
cwd: process.cwd(),
|
|
97
95
|
stdio: 'inherit',
|
|
96
|
+
shell: isWin,
|
|
98
97
|
env: {
|
|
99
98
|
...process.env,
|
|
100
99
|
JSTAR_CWD: process.cwd()
|