diff --git a/scripts/dev/gateway-smoke.ts b/scripts/dev/gateway-smoke.ts index 9509709ee2af..973847721702 100644 --- a/scripts/dev/gateway-smoke.ts +++ b/scripts/dev/gateway-smoke.ts @@ -1,4 +1,3 @@ -// Gateway Smoke script supports OpenClaw repository automation. import { fileURLToPath } from "node:url"; import { isRecord } from "@openclaw/normalization-core/record-coerce"; import { @@ -52,26 +51,19 @@ function validateArgs(argv: readonly string[]): void { const seen = new Set(); for (let index = 0; index < argv.length; index += 1) { const arg = argv[index] ?? ""; - if (BOOLEAN_FLAGS.has(arg)) { - if (seen.has(arg)) { - throw new GatewaySmokeArgError(`${arg} was provided more than once`); - } - seen.add(arg); - continue; - } if (VALUE_FLAGS.has(arg)) { const value = argv[index + 1]; if (!value || value.startsWith("-")) { throw new GatewaySmokeArgError(`${arg} requires a value`); } - if (seen.has(arg)) { - throw new GatewaySmokeArgError(`${arg} was provided more than once`); - } - seen.add(arg); index += 1; - continue; + } else if (!BOOLEAN_FLAGS.has(arg)) { + throw new GatewaySmokeArgError(`Unknown argument: ${arg}`); } - throw new GatewaySmokeArgError(`Unknown argument: ${arg}`); + if (seen.has(arg)) { + throw new GatewaySmokeArgError(`${arg} was provided more than once`); + } + seen.add(arg); } }