mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:31:25 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -7,14 +7,20 @@ import { resolveUserPath } from "../utils.js";
|
||||
export function resolveOpenClawAgentDir(): string {
|
||||
const override =
|
||||
process.env.OPENCLAW_AGENT_DIR?.trim() || process.env.PI_CODING_AGENT_DIR?.trim();
|
||||
if (override) return resolveUserPath(override);
|
||||
if (override) {
|
||||
return resolveUserPath(override);
|
||||
}
|
||||
const defaultAgentDir = path.join(resolveStateDir(), "agents", DEFAULT_AGENT_ID, "agent");
|
||||
return resolveUserPath(defaultAgentDir);
|
||||
}
|
||||
|
||||
export function ensureOpenClawAgentEnv(): string {
|
||||
const dir = resolveOpenClawAgentDir();
|
||||
if (!process.env.OPENCLAW_AGENT_DIR) process.env.OPENCLAW_AGENT_DIR = dir;
|
||||
if (!process.env.PI_CODING_AGENT_DIR) process.env.PI_CODING_AGENT_DIR = dir;
|
||||
if (!process.env.OPENCLAW_AGENT_DIR) {
|
||||
process.env.OPENCLAW_AGENT_DIR = dir;
|
||||
}
|
||||
if (!process.env.PI_CODING_AGENT_DIR) {
|
||||
process.env.PI_CODING_AGENT_DIR = dir;
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user