fix(paths): update legacy config filenames to use resolved state directory
This commit is contained in:
parent
a81e079d76
commit
92eae97961
@ -55,11 +55,12 @@ describe("state + config path candidates", () => {
|
||||
it("returns legacy filenames when state dir override is set", () => {
|
||||
const env = { OPENCLAW_STATE_DIR: "/custom/state" } as NodeJS.ProcessEnv;
|
||||
const candidates = resolveDefaultConfigCandidates(env, () => "/home/test");
|
||||
const base = path.resolve("/custom/state");
|
||||
expect(candidates).toEqual([
|
||||
"/custom/state/openclaw.json",
|
||||
"/custom/state/clawdbot.json",
|
||||
"/custom/state/moltbot.json",
|
||||
"/custom/state/moldbot.json",
|
||||
path.join(base, "openclaw.json"),
|
||||
path.join(base, "clawdbot.json"),
|
||||
path.join(base, "moltbot.json"),
|
||||
path.join(base, "moldbot.json"),
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@ -164,7 +164,9 @@ export function resolveDefaultConfigCandidates(
|
||||
const resolved = resolveUserPath(openclawStateDir);
|
||||
return [
|
||||
path.join(resolved, CONFIG_FILENAME),
|
||||
...LEGACY_CONFIG_FILENAMES.map((name) => path.join(resolved, name)),
|
||||
path.join(resolved, "clawdbot.json"),
|
||||
path.join(resolved, "moltbot.json"),
|
||||
path.join(resolved, "moldbot.json"),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user