Skip to content

Commit 427119c

Browse files
committed
fix flag defaults
1 parent fd7d544 commit 427119c

File tree

1 file changed

+3
-1
lines changed
  • packages/core/src/scripts

1 file changed

+3
-1
lines changed

packages/core/src/scripts/cli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export type Flags = {
1818

1919
function defaultFlags(flags: Partial<Flags>, defaults: Partial<Flags>) {
2020
for (const [key, value] of Object.entries(flags)) {
21-
if (!(key in defaults)) throw new Error(`Option '${key}' is unsupported for this command`);
21+
if (value !== undefined && !(key in defaults)) {
22+
throw new Error(`Option '${key}' is unsupported for this command`);
23+
}
2224

2325
// should we default the flag?
2426
if (value === undefined) {

0 commit comments

Comments
 (0)