Skip to content

Commit

Permalink
Fix child process execution
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Nov 15, 2021
1 parent 2905791 commit 74560b7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/util/childProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ var childProcess = require('child_process');
var which = require('./which');

function execFile(cmd, args, opt, cb) {
cmd = which(cmd);
childProcess.execFile(cmd, args, opt, cb);
try {
cmd = which.sync(cmd);
} catch (e) {
cb(e);
}
return childProcess.execFile(cmd, args, opt, cb);
}

function spawn(cmd, args, opt) {
cmd = which(cmd);
childProcess.spawn(cmd, args, opt);
cmd = which.sync(cmd);
return childProcess.spawn(cmd, args, opt);
}

module.exports = {
Expand Down

0 comments on commit 74560b7

Please sign in to comment.