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

[Bug/Feature Proposal] yarn why - exits with code 0 if no package matches #6076

Open
martinjlowm opened this issue Jul 9, 2018 · 0 comments
Assignees
Labels

Comments

@martinjlowm
Copy link

The following segment of yarn why safely returns, despite logging an error.

if (matches.length <= 0) {
reporter.error(reporter.lang('whyUnknownMatch'));
return;
}

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.

@ghost ghost assigned arcanis Jul 9, 2018
@ghost ghost added the triaged label Jul 9, 2018
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

2 participants