fix: migrate legacy state dirs

This commit is contained in:
Peter Steinberger
2026-01-30 04:26:00 +01:00
parent 67918dc41b
commit 9886fd1a5a
4 changed files with 14 additions and 12 deletions

View File

@@ -16,10 +16,10 @@ export function resolveIsNixMode(env: NodeJS.ProcessEnv = process.env): boolean
export const isNixMode = resolveIsNixMode();
const LEGACY_STATE_DIRNAMES = [] as const;
const LEGACY_STATE_DIRNAMES = [".clawdbot", ".moltbot", ".moldbot"] as const;
const NEW_STATE_DIRNAME = ".openclaw";
const CONFIG_FILENAME = "openclaw.json";
const LEGACY_CONFIG_FILENAMES = [] as const;
const LEGACY_CONFIG_FILENAMES = ["clawdbot.json", "moltbot.json", "moldbot.json"] as const;
function legacyStateDirs(homedir: () => string = os.homedir): string[] {
return LEGACY_STATE_DIRNAMES.map((dir) => path.join(homedir(), dir));