mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-31 03:41:51 +00:00
fix: harden update channel switching
This commit is contained in:
@@ -7,6 +7,7 @@ import { setProgramContext } from "./program-context.js";
|
||||
|
||||
export function buildProgram() {
|
||||
const program = new Command();
|
||||
program.enablePositionalOptions();
|
||||
const ctx = createProgramContext();
|
||||
const argv = process.argv;
|
||||
|
||||
|
||||
@@ -104,6 +104,11 @@ describe("ensureConfigReady", () => {
|
||||
commandPath: ["status"],
|
||||
expectedDoctorCalls: 0,
|
||||
},
|
||||
{
|
||||
name: "skips doctor flow for update status",
|
||||
commandPath: ["update", "status"],
|
||||
expectedDoctorCalls: 0,
|
||||
},
|
||||
{
|
||||
name: "runs doctor flow for commands that may mutate state",
|
||||
commandPath: ["message"],
|
||||
@@ -145,7 +150,6 @@ describe("ensureConfigReady", () => {
|
||||
|
||||
await ensureConfigReady({ runtime: runtimeA as never, commandPath: ["message"] });
|
||||
await ensureConfigReady({ runtime: runtimeB as never, commandPath: ["message"] });
|
||||
|
||||
expect(loadAndMaybeMigrateDoctorConfigMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user