fix: honor gateway --dev flag
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user