refactor: streamline routed cli setup
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { Command } from "commander";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { emitCliBanner } from "../banner.js";
|
||||
import { getCommandPath, hasHelpOrVersion, isReadOnlyCommand } from "../argv.js";
|
||||
import { getCommandPath, hasHelpOrVersion, shouldMigrateState } from "../argv.js";
|
||||
import { ensureConfigReady } from "./config-guard.js";
|
||||
|
||||
function setProcessTitleForCommand(actionCommand: Command) {
|
||||
@@ -22,7 +22,7 @@ export function registerPreActionHooks(program: Command, programVersion: string)
|
||||
if (hasHelpOrVersion(argv)) return;
|
||||
const [primary] = getCommandPath(argv, 1);
|
||||
if (primary === "doctor") return;
|
||||
const migrateState = !isReadOnlyCommand(argv);
|
||||
const migrateState = shouldMigrateState(argv);
|
||||
await ensureConfigReady({ runtime: defaultRuntime, migrateState });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user