From 28a6cd5ea582cc0ccd924faaeef488389b757342 Mon Sep 17 00:00:00 2001 From: aalej Date: Wed, 8 Apr 2026 23:23:47 +0800 Subject: [PATCH 1/4] handle powershell stripping commas --- src/command.spec.ts | 54 +++++++++++++++++++++++++++++++++++++++++++++ src/command.ts | 10 +++++++++ 2 files changed, 64 insertions(+) diff --git a/src/command.spec.ts b/src/command.spec.ts index 37fea103385..27d36340fef 100644 --- a/src/command.spec.ts +++ b/src/command.spec.ts @@ -170,6 +170,60 @@ describe("Command", () => { }); }); }); + + it("should handle comma separated values in 'only' options", async () => { + const run = command + .action((options) => { + return { + only: options.only, + }; + }) + .runner(); + + const result = await run({ + only: "firestore,hosting,auth", + }); + + expect(result).to.deep.eq({ + only: "firestore,hosting,auth", + }); + }); + + it("should normalize space separated values in 'only' options", async () => { + const run = command + .action((options) => { + return { + only: options.only, + }; + }) + .runner(); + + const result = await run({ + only: "firestore hosting auth", + }); + + expect(result).to.deep.eq({ + only: "firestore,hosting,auth", + }); + }); + + it("should normalize space and commas separated values in 'only' options", async () => { + const run = command + .action((options) => { + return { + only: options.only, + }; + }) + .runner(); + + const result = await run({ + only: "firestore, hosting, auth", + }); + + expect(result).to.deep.eq({ + only: "firestore,hosting,auth", + }); + }); }); describe("validateProjectId", () => { diff --git a/src/command.ts b/src/command.ts index 8fd0e98f5f0..bb5c68dde1c 100644 --- a/src/command.ts +++ b/src/command.ts @@ -342,6 +342,16 @@ export class Command { options.configPath = getInheritedOption(options, "config"); } + if (getInheritedOption(options, "only")) { + // Handle cases where PowerShell replaces commas with spaces. + // see https://github.com/firebase/firebase-tools/issues/7506 + options.only = getInheritedOption(options, "only") + .split(/[\s,]+/) + .filter(Boolean) + .join(","); + console.log(`--- ${options.only}`); + } + try { options.config = Config.load(options); } catch (e: any) { From 4b947a1425b8fae1d62663adc45c2fcb737879fa Mon Sep 17 00:00:00 2001 From: aalej Date: Wed, 8 Apr 2026 23:40:45 +0800 Subject: [PATCH 2/4] remove console log --- src/command.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/command.ts b/src/command.ts index bb5c68dde1c..2f828caaa0b 100644 --- a/src/command.ts +++ b/src/command.ts @@ -349,7 +349,6 @@ export class Command { .split(/[\s,]+/) .filter(Boolean) .join(","); - console.log(`--- ${options.only}`); } try { From 57c2ecbc1aa9bc6bd776e16ae0324b6a5f3eaa54 Mon Sep 17 00:00:00 2001 From: aalej Date: Wed, 8 Apr 2026 23:45:34 +0800 Subject: [PATCH 3/4] changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e11a4a0f72..51e8064bf54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,2 @@ - Fixed an issue where functions deployments would silently fail (#6989) +- Fixed issue where the CLI isn't able to correctly parse command arguments on PowerShell (#7506) From de7689f918daa2f1fe075150a868c4307355a565 Mon Sep 17 00:00:00 2001 From: aalej Date: Thu, 9 Apr 2026 01:21:53 +0800 Subject: [PATCH 4/4] add ai suggestion --- src/command.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/command.ts b/src/command.ts index 2f828caaa0b..ff6915830a1 100644 --- a/src/command.ts +++ b/src/command.ts @@ -342,10 +342,11 @@ export class Command { options.configPath = getInheritedOption(options, "config"); } - if (getInheritedOption(options, "only")) { + const onlyOption = getInheritedOption(options, "only"); + if (onlyOption) { // Handle cases where PowerShell replaces commas with spaces. // see https://github.com/firebase/firebase-tools/issues/7506 - options.only = getInheritedOption(options, "only") + options.only = onlyOption .split(/[\s,]+/) .filter(Boolean) .join(",");