UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

29 lines (28 loc) • 1.15 kB
import { t as formatErrorMessage } from "./errors-BKzCeTYb.mjs"; import { t as note } from "./note-CnLgHvug.mjs"; import { t as readBackupArchiveDirectories } from "./backup-run-records-B0d7Qm1y.mjs"; import { r as maintainBackupScratch } from "./backup-scratch-DYV2vJfy.mjs"; import os from "node:os"; //#region src/commands/doctor-backup-scratch.ts async function noteBackupScratchHealth(e, t) { const n = [os.tmpdir()]; try { n.push(...await readBackupArchiveDirectories(e)); } catch (e) { note(`Cannot discover recorded backup scratch locations: ${formatErrorMessage(e)}`, "Backups"); } const r = await maintainBackupScratch({ roots: n, repair: t }); const i = [ ...r.unchecked.map((e) => `Backup scratch awaiting lifecycle check: ${e}. Run \`openclaw doctor --fix\` to remove it if abandoned.`), ...r.reclaimed.map((e) => `Removed abandoned backup scratch: ${e}`), ...r.alreadyReclaimed.map((e) => `Backup scratch already reclaimed: ${e}`), ...r.active.map((e) => `Kept active backup scratch: ${e}`), ...r.warnings ]; if (i.length) note(i.join("\n"), "Backup scratch"); } //#endregion export { noteBackupScratchHealth };