[Bug/Feature Proposal] yarn why
- exits with code 0 if no package matches
#6076
Labels
yarn why
- exits with code 0 if no package matches
#6076
The following segment of
yarn why
safely returns, despite logging an error.yarn/src/cli/commands/why.js
Lines 157 to 160 in 1711e72
I would expect the error message to at least result in a script exit code of 1.
Also, exiting with code 1 would enable the use of a conditional upgrade as such:
yarn why pkg && yarn upgrade pkg
, thus only upgrading if the package,pkg
, is currently installed.What is the current behavior?
Invoking
yarn why
with a package that results in zero matches, displays an error and the script exits with code 0.What is the expected behavior?
Given the error:
error We couldn't find a match!
, one would expect the command to exit with code 1.The text was updated successfully, but these errors were encountered: