refactor: centralize daemon path resolution

This commit is contained in:
Peter Steinberger
2026-01-15 23:09:08 +00:00
parent 4a99b9b651
commit db9be87d94
9 changed files with 130 additions and 56 deletions

View File

@@ -58,6 +58,15 @@ describe("resolveTaskScriptPath", () => {
);
});
it("prefers CLAWDBOT_STATE_DIR over profile-derived defaults", () => {
const env = {
USERPROFILE: "C:\\Users\\test",
CLAWDBOT_PROFILE: "rescue",
CLAWDBOT_STATE_DIR: "C:\\State\\clawdbot",
};
expect(resolveTaskScriptPath(env)).toBe(path.join("C:\\State\\clawdbot", "gateway.cmd"));
});
it("handles case-insensitive 'Default' profile", () => {
const env = { USERPROFILE: "C:\\Users\\test", CLAWDBOT_PROFILE: "Default" };
expect(resolveTaskScriptPath(env)).toBe(