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

[Small] Better handling for global commands without arguments #886

Merged
merged 2 commits into from
Dec 14, 2020

Conversation

charlespierce
Copy link
Contributor

Info

  • Currently, if a user runs a global install or uninstall without any package arguments (e.g. npm i -g or yarn global remove), we show:
note: Volta is processing each package separately
  • However, since there are no arguments, we then effectively no-op by iterating over an empty list.
  • This leads to a confusing situation where there's no feedback about success or failure to the user (and the return code is 0, indicating success).
  • Since, in these situations, there aren't any tools for Volta to handle, we should treat it like a non-global situation and allow the underlying package manager to show whatever error it normally would when the user forgets the arguments.

Changes

  • Updated the parser for both npm and Yarn to handle the case of no package arguments and treat it like a non-global command.

Tested

  • Added new tests to cover this use case, confirming that the note text is not shown.

@chriskrycho chriskrycho merged commit ab80f75 into volta-cli:main Dec 14, 2020
@charlespierce charlespierce deleted the globals_without_arguments branch December 14, 2020 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants