Files
overlord/Overlord-Server/src/server/runtime-paths.ts
T

16 lines
360 B
TypeScript
Raw Normal View History

2026-03-05 00:04:26 -06:00
import path from "path";
import fs from "fs";
export function resolveRuntimeRoot(cwd: string = process.cwd()): string {
const explicitRoot = process.env.OVERLORD_ROOT?.trim();
if (explicitRoot) {
return path.resolve(explicitRoot);
}
if (fs.existsSync(path.join(cwd, "Overlord-Client"))) {
return cwd;
}
return path.resolve(cwd, "..");
}