mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:50:42 +00:00
QA lab: respect homedir fallback for CODEX_HOME
This commit is contained in:
@@ -181,6 +181,7 @@ describe("qa multipass runtime", () => {
|
||||
const fakeCodexHome = path.join(fakeHome, ".codex");
|
||||
fs.mkdirSync(fakeCodexHome, { recursive: true });
|
||||
vi.stubEnv("HOME", "");
|
||||
vi.stubEnv("CODEX_HOME", "");
|
||||
vi.spyOn(os, "homedir").mockReturnValue(fakeHome);
|
||||
|
||||
try {
|
||||
|
||||
@@ -280,8 +280,9 @@ function resolveQaLiveCliAuthEnv(baseEnv: NodeJS.ProcessEnv) {
|
||||
const codexHome = resolveUserPath(configuredCodexHome, baseEnv);
|
||||
return fs.existsSync(codexHome) ? { CODEX_HOME: codexHome } : {};
|
||||
}
|
||||
const hostHome = baseEnv.HOME?.trim() || os.homedir();
|
||||
const codexHome = path.join(hostHome, ".codex");
|
||||
const hostHome = baseEnv.HOME?.trim();
|
||||
const effectiveHome = hostHome || os.homedir();
|
||||
const codexHome = path.join(effectiveHome, ".codex");
|
||||
return fs.existsSync(codexHome) ? { CODEX_HOME: codexHome } : {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user