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
Execute child.stdout.on before child.on("exit") #224
Comments
child.stdout.on('data', stuff);
child.stdout.on('end', otherStuff); |
Everything is now printed in the correct order, but end is always undefined:
|
var code;
child.on('exit', function(c) {
code = c;
});
child.stdout.on('data', function(data) {
console.log(data);
});
child.stdout.on('end', function() {
console.log(code);
}); |
@devtristan this now results in undefined. This gives me the correct output with exit code: var child = shell.exec(cmd, {async: true, silent: true});
var output = "";
child.on('exit', function(c) {
console.log(output);
console.log('Exit code is ' + c);
});
child.stdout.on('data', function (data) {
if (!!data)
output += data;
}); |
@Synturas @kevin-smets is this resolved now? |
Assuming this is fixed (we did a heavy refactor of |
This was referenced Nov 29, 2019
This was referenced Mar 24, 2020
This was referenced Apr 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The output of this command is :
What do i have to do, to make shelljs return all data immediately and before on exit is executed ?
The text was updated successfully, but these errors were encountered: