Skip to content

Commit 6649660

Browse files
committed
Remove erroneous sub-command execution
Node’s [`spawn`][1] is intended for running external shell executables in sub-processes, not for executing node functions, as seemed the intention in this code. This change removes the use of spawn, instead calling `build` directly. This change should resolve #18. This could be adapted to use [`fork`][2] instead (which is designed to execute a function in a separate v8 process), but there doesn’t seem to be good reason for that here. [1]: https://nodejs.org/dist/v8.2.1/docs/api/child_process.html#child_process_child_process_spawn_command_args_options [2]: https://nodejs.org/dist/latest-v8.x/docs/api/child_process.html#child_process_child_process_fork_modulepath_args_options
1 parent 30edeea commit 6649660

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ program
1313
.parse(process.argv);
1414

1515
if (program.args.length > 0) {
16-
spawn(build(program.args[0]), { shell: true, stdio: 'inherit' });
16+
build(program.args[0]);
1717
} else if (program.args.length < 1) {
1818
console.log(chalk.red('Please supply a name for your new React XP app.'));
1919
}

0 commit comments

Comments
 (0)