@codemoreira/esad 1.4.6-30 ā 1.4.6-31
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/package.json +1 -1
- package/src/cli/commands/host.js +2 -1
- package/src/cli/utils/process.js +10 -2
package/package.json
CHANGED
package/src/cli/commands/host.js
CHANGED
|
@@ -86,7 +86,8 @@ module.exports = async (subcommand) => {
|
|
|
86
86
|
if (shouldStartBundler && choice !== 'c') {
|
|
87
87
|
console.log(`\nš ļø Starting Rspack Bundler in a new window...`);
|
|
88
88
|
if (process.platform === 'win32') {
|
|
89
|
-
|
|
89
|
+
const npxCmd = 'npx.cmd';
|
|
90
|
+
spawn('cmd', ['/c', 'start', '/D', cwd, npxCmd, 'react-native', 'webpack-start'], {
|
|
90
91
|
detached: true,
|
|
91
92
|
stdio: 'ignore',
|
|
92
93
|
shell: true
|
package/src/cli/utils/process.js
CHANGED
|
@@ -9,9 +9,17 @@ const { spawn } = require('cross-spawn');
|
|
|
9
9
|
*/
|
|
10
10
|
const runProcess = (cmd, args, cwd = process.cwd()) => {
|
|
11
11
|
return new Promise((resolve, reject) => {
|
|
12
|
-
|
|
12
|
+
// On Windows, npx must be executed as npx.cmd
|
|
13
|
+
const command = process.platform === 'win32' && cmd === 'npx' ? 'npx.cmd' : cmd;
|
|
14
|
+
|
|
15
|
+
const child = spawn(command, args, { stdio: 'inherit', cwd, shell: true });
|
|
16
|
+
|
|
17
|
+
child.on('error', err => {
|
|
18
|
+
reject(new Error(`Failed to spawn command ${command}: ${err.message}`));
|
|
19
|
+
});
|
|
20
|
+
|
|
13
21
|
child.on('close', code => {
|
|
14
|
-
if (code !== 0) reject(new Error(`Command ${
|
|
22
|
+
if (code !== 0) reject(new Error(`Command ${command} ${args.join(' ')} failed with exit code ${code}`));
|
|
15
23
|
else resolve();
|
|
16
24
|
});
|
|
17
25
|
});
|