UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

20 lines (19 loc) • 798 B
import { n as tryProcessCwd } from "./safe-cwd-CZqaxroH.mjs"; import { r as resolveStateDir } from "./state-dir-DiG0gXzD.mjs"; import "./paths-DAcAg5aV.mjs"; import { t as loadGlobalRuntimeDotEnvFiles } from "./dotenv-global-BwvKQuHq.mjs"; import fs from "node:fs"; import path from "node:path"; //#region src/cli/gateway-dispatch-dotenv.ts /** Load only the env files needed before dispatching a command through the gateway. */ async function loadGatewayDispatchCliDotEnv() { const e = tryProcessCwd(); if (e && fs.existsSync(path.join(e, ".env"))) { const { loadCliDotEnv: e } = await import("./dotenv-BqC7eRgR.mjs"); e(); return; } loadGlobalRuntimeDotEnvFiles({ stateEnvPath: path.join(resolveStateDir(process.env), ".env") }); } //#endregion export { loadGatewayDispatchCliDotEnv };