UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

16 lines (15 loc) • 627 B
import { c as resolveUserPath } from "./home-dir-EKmgmdPG.mjs"; import { r as resolveStateDir } from "./state-dir-DiG0gXzD.mjs"; import path from "node:path"; import os from "node:os"; //#region src/infra/config-dir.ts /** Resolves the OpenClaw config directory from state/config env overrides or home. */ function resolveConfigDir(e = process.env, t = os.homedir) { const n = e.OPENCLAW_STATE_DIR?.trim(); if (n) return resolveUserPath(n, e, t); const r = e.OPENCLAW_CONFIG_PATH?.trim(); if (r) return path.dirname(resolveUserPath(r, e, t)); return resolveStateDir(e, t); } //#endregion export { resolveConfigDir as t };