Skip to content

Commit

Permalink
fix: pages "command" can consist of multiple words
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
petebacondarwin committed May 18, 2022
1 parent 7a191a2 commit 2f1aaef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .changeset/tame-tigers-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"wrangler": patch
---

fix: pages "command" can consist of multiple words

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](https://github.com/cloudflare/wrangler2/issues/965)
2 changes: 1 addition & 1 deletion packages/wrangler/src/pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ const createDeployment: CommandModule<
export const pages: BuilderCallback<unknown, unknown> = (yargs) => {
return yargs
.command(
"dev [directory] [-- command]",
"dev [directory] [-- command..]",
"🧑‍💻 Develop your full-stack Pages application locally",
(yargs) => {
return yargs
Expand Down

0 comments on commit 2f1aaef

Please sign in to comment.