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

fix: pages "command" can consist of multiple words #1057

Merged
merged 1 commit into from
May 19, 2022

Conversation

petebacondarwin
Copy link
Contributor

On Windows, the following command wrangler pages dev -- foo bar would error
saying that bar was not a known argument. This is because foo and bar are
passed to Yargs as separate arguments.

A workaround is to put the command in quotes: wrangler pages dev -- "foo bar".
But this fix makes the command argument variadic, which also solves the problem.

Fixes #965

@changeset-bot
Copy link

changeset-bot bot commented May 18, 2022

🦋 Changeset detected

Latest commit: b3d0878

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented May 18, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2347996537/npm-package-wrangler-1057

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1057/npm-package-wrangler-1057

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2347996537/npm-package-wrangler-1057 dev path/to/script.js

@petebacondarwin
Copy link
Contributor Author

Not sure if I can come up with a reasonable test that is not overkill for this small fix...

On Windows, the following command `wrangler pages dev -- foo bar` would error
saying that `bar` was not a known argument. This is because `foo` and `bar` are
passed to Yargs as separate arguments.

A workaround is to put the command in quotes: `wrangler pages dev -- "foo bar"`.
But this fix makes the `command` argument variadic, which also solves the problem.

Fixes [cloudflare#965](cloudflare#965)
Copy link
Contributor

@GregBrimble GregBrimble left a comment

Choose a reason for hiding this comment

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

Thanks @petebacondarwin !

@threepointone threepointone merged commit 608dcd9 into cloudflare:main May 19, 2022
@github-actions github-actions bot mentioned this pull request May 19, 2022
@petebacondarwin petebacondarwin deleted the fix-pages-command branch June 29, 2022 11:16
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.

🐛 BUG: wrangler pages dev -- npm run serve gives an "Unknown argument" error
3 participants