Skip to content

Detect number of parameters, exit if less then 2.#47

Merged
rstacruz merged 1 commit into
pnpm:masterfrom
PeterDaveHello:patch-1
Jan 31, 2016
Merged

Detect number of parameters, exit if less then 2.#47
rstacruz merged 1 commit into
pnpm:masterfrom
PeterDaveHello:patch-1

Conversation

@PeterDaveHello

Copy link
Copy Markdown
Contributor

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 parameter and then print pnpm-install --help to improve the UX.

@rstacruz

Copy link
Copy Markdown
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.

@rstacruz

Copy link
Copy Markdown
Member

(For "pnpm install" anyway)

@rstacruz

Copy link
Copy Markdown
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.
@PeterDaveHello

Copy link
Copy Markdown
Contributor Author

Sorry, I am so careless that I forgot it, just updated, thanks.

@PeterDaveHello

Copy link
Copy Markdown
Contributor Author

Anything I need to change now?

Comment thread bin/pnpm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably eventually show a help screen like npm --help... but for another time; for now this is gold

@rstacruz

Copy link
Copy Markdown
Member

Thanks!

rstacruz added a commit that referenced this pull request Jan 31, 2016
Detect number of parameters, exit if less then 2.
@rstacruz rstacruz merged commit 2d0b515 into pnpm:master Jan 31, 2016
@PeterDaveHello PeterDaveHello deleted the patch-1 branch February 1, 2016 05:32
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
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