We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
child_process.exec
If execSync.exec is used before node's child_process.exec, the exec callback to child_process.exec is never called.
execSync.exec
This only happens when multiple calls to execSync and child_process.exec are invoked one after the other.
Example script to demonstrate the issue:
var exec = require('child_process').exec, execSync = require('execSync'); var executions = 5; var execFunctions = []; for (var i = 0; i < executions; ++i) { addExecFunction(i); } var completedExecutions = 0; execFunctions.forEach(function(execFunction) { execFunction(function(err, val) { if (++completedExecutions == executions) { console.log('all complete!'); } }); }); function addExecFunction(i) { execFunctions.push(function(callback) { console.log(i + ' start'); var pwd = execSync.exec('cd && pwd').stdout.replace('\n', ''); //var pwd = '~'; var command = 'ls -l ' + pwd; //console.log(command); exec(command, function onProcessTermination(err, stdout, stderr) { console.log(i + ' complete'); callback(null, i); }); }); }
output:
$ node testExec.js 0 start 1 start 2 start 3 start 4 start 3 complete 4 complete
When commenting out var pwd = execSync.exec(...);, and uncommenting var pwd = '~'; the script works fine.
var pwd = execSync.exec(...);
var pwd = '~';
PS: I'm running this on a linux box.
The text was updated successfully, but these errors were encountered:
This is pretty serious. This module effectively breaks the process.exec() function when used.
process.exec()
Sorry, something went wrong.
No branches or pull requests
If
execSync.exec
is used before node'schild_process.exec
, the exec callback to child_process.exec is never called.This only happens when multiple calls to execSync and child_process.exec are invoked one after the other.
Example script to demonstrate the issue:
output:
When commenting out
var pwd = execSync.exec(...);
, and uncommentingvar pwd = '~';
the script works fine.PS: I'm running this on a linux box.
The text was updated successfully, but these errors were encountered: