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

Excessive error messages when using --if argument. #88

Open
yliu-d opened this issue Jan 5, 2020 · 2 comments
Open

Excessive error messages when using --if argument. #88

yliu-d opened this issue Jan 5, 2020 · 2 comments
Labels

Comments

@yliu-d
Copy link

yliu-d commented Jan 5, 2020

Not sure if this is expected behavior or not.

if you run yarn wsrun --if ... and the condition script failed, error messages like these are in the output:

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

but these are not useful information, it is expected for the command to fail when the if condition does not met.

In the code, wsrun always set silent option to true if the command is used for the --if argument, but the code is not checking silent flag before output to console, I have to add if (!this.opts.silent) on line

this.console.log(this.autoAugmentLine(line))
and
this.console.error(this.autoAugmentLine(line))
to mute all the output for command evaluation results, so that I can mute all output for commands used in --if arguments.

In this case, should wsrun write anything to console if silent is set to true? If yes, can we add a command line option to mute all output for the commands used as if conditions?

@spion
Copy link
Collaborator

spion commented Jan 6, 2020

Looks like this might be a regression - I don't recall this happening in the past

@spion spion added the bug label Jan 6, 2020
@ArnSch
Copy link
Contributor

ArnSch commented Jan 10, 2020

Hey!

Just adding a bit more info: I tried several versions (all the 5.x, 4.0.2, about half the 3.x and a couple of 2.x) and all those that work with the flags I have have the issue @yliu-d describes above.

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

No branches or pull requests

3 participants