Detect number of parameters, exit if less then 2.#47
Merged
Conversation
Member
|
Oh wait. This is actually incorrect... "Pnpm install" will read package.json and install whatever's on there. Except in your case, package.json is absent so it can't read "dependencies" from it (hence the error). It was actually correct behavior, albeit with an unhelpful message. |
Member
|
(For "pnpm install" anyway) |
Member
|
But yeah, "pnpm" with no args should default to something, and not give an error, which it probably does right now |
Without this detection, if a user gives no parameter, the error message will be: > shift: can't shift that many Tell the users to pass at least 1 parameters and then print `pnpm-install --help` to improve the UX.
af427d0 to
cc0fba2
Compare
Contributor
Author
|
Sorry, I am so careless that I forgot it, just updated, thanks. |
Contributor
Author
|
Anything I need to change now? |
Member
There was a problem hiding this comment.
this should probably eventually show a help screen like npm --help... but for another time; for now this is gold
Member
|
Thanks! |
rstacruz
added a commit
that referenced
this pull request
Jan 31, 2016
Detect number of parameters, exit if less then 2.
zkochan
pushed a commit
that referenced
this pull request
May 11, 2018
* fix: flatten by alias * fix: rename field, other fixes * fix: more bug fixes * fix: make all tests run, write a (failing) test for pruning * fix: reflatten after pruning * fix: do not log installation/removal of hoisted aliases * fix: follow review comments * fix: use muteLogs instead of skipLogs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without this detection,
if a user gives no parameter, the error message will be:
Tell the users to pass at least 1 parameter and then print
pnpm-install --helpto improve the UX.