fix: honor gateway --dev flag

This commit is contained in:
Peter Steinberger
2026-01-09 15:25:51 +01:00
parent 2c5ec94843
commit 80ff2dc77d
4 changed files with 51 additions and 3 deletions

View File

@@ -33,12 +33,18 @@ export function parseCliProfileArgs(argv: string[]): CliProfileParseResult {
const out: string[] = argv.slice(0, 2);
let profile: string | null = null;
let sawDev = false;
let sawCommand = false;
const args = argv.slice(2);
for (let i = 0; i < args.length; i += 1) {
const arg = args[i];
if (arg === undefined) continue;
if (sawCommand) {
out.push(arg);
continue;
}
if (arg === "--dev") {
if (profile && profile !== "dev") {
return { ok: false, error: "Cannot combine --dev with --profile" };
@@ -66,6 +72,12 @@ export function parseCliProfileArgs(argv: string[]): CliProfileParseResult {
continue;
}
if (!arg.startsWith("-")) {
sawCommand = true;
out.push(arg);
continue;
}
out.push(arg);
}