Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.

command line Argument support for both yarn and npm #629

Merged
merged 5 commits into from
Oct 3, 2018

Conversation

jeeftor
Copy link
Contributor

@jeeftor jeeftor commented Jun 4, 2018

This is a redo of my previous command line argument pull request that only supported yarn.

It has been tested with both:

npm run dev -- --arg1=val1 --arg2
yarn dev run --arg1=val1 --arg2

The -- flag must be present in npm for arguments to be passed along

uses process.env.npm_execpath to figure out if yarn or npm was used to launch the app - and then will correctly parse and pass on the command line args.

@XanderLuciano
Copy link
Collaborator

Would be helpful if this was also added to the documentation somewhere. Maybe under npm scripts?

@jeeftor
Copy link
Contributor Author

jeeftor commented Jul 27, 2018

@XanderLuciano done as requested

Copy link
Collaborator

@XanderLuciano XanderLuciano left a comment

Choose a reason for hiding this comment

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

LGTM, short and simple, yet handy addition.

Improve formatting
Remove automatically inserted newline at end of file
@XanderLuciano
Copy link
Collaborator

I guess the online editor forces the newline... I'll just manually remove it post merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants