feat(doctor): branch into post-upgrade probe runner when --post-upgrade · openclaw/openclaw@7304928
arniesaha
·
2026-06-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import os from "node:os"; |
| 2 | +import path from "node:path"; |
1 | 3 | import type { RuntimeEnv } from "../runtime.js"; |
| 4 | +import { runPostUpgradeProbes } from "./doctor-post-upgrade.js"; |
2 | 5 | import type { DoctorOptions } from "./doctor-prompter.js"; |
3 | 6 | |
4 | 7 | export async function doctorCommand(runtime?: RuntimeEnv, options?: DoctorOptions): Promise<void> { |
| 8 | +if (options?.postUpgrade) { |
| 9 | +const installsPath = path.join(os.homedir(), ".openclaw", "plugins", "installs.json"); |
| 10 | +const report = await runPostUpgradeProbes({ installsPath }); |
| 11 | +if (options.json) { |
| 12 | +console.log(JSON.stringify(report, null, 2)); |
| 13 | +} else { |
| 14 | +for (const f of report.findings) { |
| 15 | +console.log(`[${f.level}] ${f.code}: ${f.message}`); |
| 16 | +} |
| 17 | +if (report.findings.length === 0) { |
| 18 | +console.log("post-upgrade: no findings"); |
| 19 | +} |
| 20 | +} |
| 21 | +const hasError = report.findings.some((f) => f.level === "error"); |
| 22 | +runtime?.exit(hasError ? 1 : 0); |
| 23 | +return; |
| 24 | +} |
5 | 25 | const doctorHealth = await import("../flows/doctor-health.js"); |
6 | 26 | await doctorHealth.doctorCommand(runtime, options); |
7 | 27 | } |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。