From eb4256ab35b08af37ba515a668dd89719d958a40 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Wed, 18 Oct 2023 09:51:01 +0100 Subject: [PATCH] add quotes to wrangler init names containing whitespaces before delegating to C3 --- .changeset/lazy-chicken-lay.md | 5 +++++ packages/wrangler/src/init.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/lazy-chicken-lay.md diff --git a/.changeset/lazy-chicken-lay.md b/.changeset/lazy-chicken-lay.md new file mode 100644 index 000000000000..4cda01973931 --- /dev/null +++ b/.changeset/lazy-chicken-lay.md @@ -0,0 +1,5 @@ +--- +"wrangler": patch +--- + +add quotes to wrangler init names containing whitespaces before delegating to C3 diff --git a/packages/wrangler/src/init.ts b/packages/wrangler/src/init.ts index 2ff4d1540d38..6f8def53be0d 100644 --- a/packages/wrangler/src/init.ts +++ b/packages/wrangler/src/init.ts @@ -238,7 +238,8 @@ export async function initHandler(args: InitArgs) { const c3Arguments: string[] = []; if (args.name) { - c3Arguments.push(args.name); + const name = /\s/.test(args.name) ? `"${args.name}"` : args.name; + c3Arguments.push(name); } if (yesFlag) {