Skip to content

child_process: Support bash as shell.

Rodrigo Muino Tomonari requested to merge github/fork/gucong3000/patch-1 into master

Usage

if( process.platform === 'win32' ) {
    process.env.comspec = 'C:\\Program Files\\Git\\bin\\bash.exe';
}
const exec = require('child_process').exec;
exec('cat *.js bad_file | wc -l', (error, stdout, stderr) => {
  if (error) {
    console.error(`exec error: ${error}`);
    return;
  }
  console.log(`stdout: ${stdout}`);
  console.log(`stderr: ${stderr}`);
});
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

Merge request reports

Loading