hfour / hfour/wsrun

Excessive error messages when using `--if` argument.

Open
#88 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
512
Forks
30
PR merge metrics
No merged PRs in 30d

Description

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 https://github.com/hfour/wsrun/blob/0a75328dfb178740d22cdcbf19462d58edad90e6/src/cmd-process.ts#L154 and https://github.com/hfour/wsrun/blob/0a75328dfb178740d22cdcbf19462d58edad90e6/src/cmd-process.ts#L159 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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.