xiaozuoassistant 0.1.96 → 0.1.97
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/cli.js +4 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -340,7 +340,10 @@ async function stopServer() {
|
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
async function runCommand(cmd, cmdArgs, options = {}) {
|
|
343
|
-
|
|
343
|
+
// On Windows, use npm.cmd instead of npm
|
|
344
|
+
const command = process.platform === 'win32' && cmd === 'npm' ? 'npm.cmd' : cmd;
|
|
345
|
+
// For Windows, use shell: true to ensure commands are executed correctly
|
|
346
|
+
const child = spawn(command, cmdArgs, { stdio: 'inherit', shell: process.platform === 'win32', ...options });
|
|
344
347
|
const code = await new Promise((resolve) => child.on('close', resolve));
|
|
345
348
|
return typeof code === 'number' ? code : 1;
|
|
346
349
|
}
|