fix: run doctor config flow once
This commit is contained in:
@@ -5,6 +5,7 @@ import type { RuntimeEnv } from "../../runtime.js";
|
|||||||
import { formatCliCommand } from "../command-format.js";
|
import { formatCliCommand } from "../command-format.js";
|
||||||
|
|
||||||
const ALLOWED_INVALID_COMMANDS = new Set(["doctor", "logs", "health", "help", "status", "service"]);
|
const ALLOWED_INVALID_COMMANDS = new Set(["doctor", "logs", "health", "help", "status", "service"]);
|
||||||
|
let didRunDoctorConfigFlow = false;
|
||||||
|
|
||||||
function formatConfigIssues(issues: Array<{ path: string; message: string }>): string[] {
|
function formatConfigIssues(issues: Array<{ path: string; message: string }>): string[] {
|
||||||
return issues.map((issue) => `- ${issue.path || "<root>"}: ${issue.message}`);
|
return issues.map((issue) => `- ${issue.path || "<root>"}: ${issue.message}`);
|
||||||
@@ -14,10 +15,13 @@ export async function ensureConfigReady(params: {
|
|||||||
runtime: RuntimeEnv;
|
runtime: RuntimeEnv;
|
||||||
commandPath?: string[];
|
commandPath?: string[];
|
||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
await loadAndMaybeMigrateDoctorConfig({
|
if (!didRunDoctorConfigFlow) {
|
||||||
options: { nonInteractive: true },
|
didRunDoctorConfigFlow = true;
|
||||||
confirm: async () => false,
|
await loadAndMaybeMigrateDoctorConfig({
|
||||||
});
|
options: { nonInteractive: true },
|
||||||
|
confirm: async () => false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const snapshot = await readConfigFileSnapshot();
|
const snapshot = await readConfigFileSnapshot();
|
||||||
const commandName = params.commandPath?.[0];
|
const commandName = params.commandPath?.[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user