-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
The all
stream and stderr: 'inherit'
#344
Comments
all
stream and `stderr: 'inherit'all
stream and stderr: 'inherit'
Thanks for reaching out @novemberborn! Would this work for you if you consumed Side question: you need to inherit Note: if by any chance you do not call |
I'm using
I don't care about memory. I think the solution may be to consume Indeed I have another test which asserts against |
Thanks for explaining this. Could you please provide with a code example so I can better understand your problem?
Could you provide with a code example reproducing this? This would be a bug. |
I think a workaround is to call const proc = execa("echo", ["hello"], {
buffer: false,
stderr: "inherit"
});
proc.stdout.pipe(process.stdout);
proc.all.resume(); |
I am not fully understanding what the original problem of this issue nor the problem this workaround is fixing: @tiagonapoli could you please describe it? For example taking your example, if I remove the |
This snippet shows the problem I was experiencing (which was the issue I #350): const execa = require("execa");
const go = async () => {
try {
const proc = execa("echo", ["hello"], {
buffer: false,
stderr: "inherit"
});
proc.stdout.pipe(process.stdout);
// proc.all.resume();
const procRes = await proc;
console.log(procRes);
} catch (err) {
console.log("CAUGHT ERROR", err);
}
console.log("============= DONE ================");
};
go(); The output is correctly piped to |
Great, thanks! That is a problem indeed! Your example can be reduced to simply: const execa = require("execa");
(async () => {
await execa("echo", { buffer: false });
// This never gets printed
console.log('Done');
})(); |
PR at #353. |
This should now be fixed. Also This change will be released in the next major release. |
Thanks for the update @ehmicky. Apologies for not having the time to investigate more deeply. Thanks for fixing this @tiagonapoli! |
I'm using
execa
to launch a child process that logs JSON tostdout
. Each of these lines are parsed and consumed.I've set
buffer
tofalse
. I'm inheritingstderr
since I do not need to parse it.I now need to fully consume both
stdout
, which is fair enough, andall
, even though it only contains the data fromstdout
which I've already consumed.Is there a way of opting out of using
all
?The text was updated successfully, but these errors were encountered: