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

when Filtering no matching, exit code may be not 0? #7403

Closed
2 of 4 tasks
hxsf opened this issue Dec 12, 2023 · 3 comments · Fixed by #7409
Closed
2 of 4 tasks

when Filtering no matching, exit code may be not 0? #7403

hxsf opened this issue Dec 12, 2023 · 3 comments · Fixed by #7409

Comments

@hxsf
Copy link

hxsf commented Dec 12, 2023

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

v8

Which area(s) of pnpm are affected? (leave empty if unsure)

CLI

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

pnpm --filter "$wrong_name" "$any_entry"
it will print No projects matched the filters in xxxxx but exit code is 0.

Describe the Bug

when use pnpm Filtering (No projects matched) in some script/dockerfile will not make workflow failed.

Expected Behavior

exit code !== 0

Which Node.js version are you using?

v21.3.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

@zkochan
Copy link
Member

zkochan commented Dec 12, 2023

I don't think it should fail. Why should it? You can filter for instance by changed packages, if no packages were changed, it is OK that nothing is found.

@hxsf
Copy link
Author

hxsf commented Dec 13, 2023

I don't think it should fail. Why should it? You can filter for instance by changed packages, if now packages were changed, it is OK that nothing is found.

Oh, I forgot that. In my case, some typo or workflow script will run pnpm --filter "$wrong_package_name" (yes, I use it in pnpm workspace).

So, maybe we can add an option look like --filter "xxxxx" --fail like curl --fail ?

@zkochan
Copy link
Member

zkochan commented Dec 21, 2023

The option sounds good to me.

zkochan added a commit that referenced this issue Dec 26, 2023
close #7403

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
gluxon pushed a commit to gluxon/pnpm that referenced this issue Dec 27, 2023
close pnpm#7403

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants