-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Fix CLI arg parsing to allow usage with no arguments #12925
Conversation
🦋 Changeset detectedLatest commit: 6e86d6d The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -5,8 +5,8 @@ let arg = require("arg"); | |||
// default `NODE_ENV` so React loads the proper version in it's CJS entry script. | |||
// We have to do this before importing `run.ts` since that is what imports | |||
// `react` (indirectly via `react-router`) | |||
let args = arg({}, { argv: process.argv.slice(2), stopAtPositional: true }); | |||
if (args._[0] === "dev") { | |||
let args = arg({}, { argv: process.argv.slice(2), permissive: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argv
already defaults to process.argv.slice(2)
, so we could remove that
let args = arg({}, { argv: process.argv.slice(2), permissive: true }); | |
let args = arg({}, { permissive: true }); |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
See https://github.com/vercel/arg#permissive
Closes #12606