Skip to content
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

Allow and separate stderr output #129

Open
cawoodm opened this issue Dec 29, 2020 · 2 comments
Open

Allow and separate stderr output #129

cawoodm opened this issue Dec 29, 2020 · 2 comments

Comments

@cawoodm
Copy link

cawoodm commented Dec 29, 2020

It seems impossible currently to receive output from a powershell script which outputs on stderr for example with Write-Error.

Firstly, if any output is on stderr then the promise is rejected unconditionally (invocationHadErrors).
Secondly, all output is captured into the same stream.

lib/Shell.js

This script seems to be combining stdout and stderr:

this.streams.stdout.pipe(psOut);
this.streams.stderr.pipe(psOut);

It would be more powerful if one could call a powershell script and not assume that a single error is the end of the script. PowerShell itself offers $ErrorActionPreference="continue" whereby a script can output errors and still continue running.

@rannn505
Copy link
Owner

rannn505 commented Jan 1, 2021

@cawoodm Liked the idea very much!
I'm about to release a new version in the coming days, would you like to help me think of a way to implement this in the new code?

@cawoodm
Copy link
Author

cawoodm commented Jan 2, 2021

Sure. I think we should provide an ErrorActionPreferenceoption and maybe a SeparateStdErroption.

You're moving to TypeScript right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants