Skip to content

Commit bf1bce3

Browse files
committed
fix: revert unknown-subcommand guard that broke positional project name arg
1 parent fb4bd37 commit bf1bce3

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

src/cli.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ afterEach(async () => {
4646
});
4747

4848
describe('dispatchSubcommand', () => {
49-
it('throws for unknown subcommand', async () => {
49+
it('returns false for unknown subcommand', async () => {
5050
const { dispatchSubcommand } = await import('./cli.js');
51-
await expect(dispatchSubcommand(['node', 'cli.js', 'unknown'])).rejects.toThrow(
52-
'Unknown subcommand: "unknown"',
53-
);
51+
expect(await dispatchSubcommand(['node', 'cli.js', 'unknown'])).toBe(false);
5452
});
5553

5654
it('returns true and runs add-app-extension for matching subcommand', async () => {

src/cli.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ export async function dispatchSubcommand(argv: string[]): Promise<boolean> {
120120
return true;
121121
}
122122

123-
if (subcommand && !subcommand.startsWith('--')) {
124-
throw new Error(`Unknown subcommand: "${subcommand}". Available: add-app-extension`);
125-
}
126-
127123
return false;
128124
}
129125

0 commit comments

Comments
 (0)