Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make exec.spawnProcess work across platforms #13156

Merged
merged 2 commits into from Jan 31, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion build-system/exec.js
Expand Up @@ -21,6 +21,9 @@

const childProcess = require('child_process');

const shellCmd = (process.platform == 'win32') ? 'cmd' : '/bin/sh';
const shellFlag = (process.platform == 'win32') ? '/C' : '-c';

/**
* Spawns the given command in a child process with the given options.
*
Expand All @@ -29,7 +32,7 @@ const childProcess = require('child_process');
* @return {<Object>} Process info.
*/
function spawnProcess(cmd, options) {
return childProcess.spawnSync('/bin/sh', ['-c', cmd], options);
return childProcess.spawnSync(shellCmd, [shellFlag, cmd], options);
}

/**
Expand Down