diff --git a/scripts/src/runtime-env.ts b/scripts/src/runtime-env.ts index 5e744b28..ba4cfd44 100644 --- a/scripts/src/runtime-env.ts +++ b/scripts/src/runtime-env.ts @@ -1,7 +1,12 @@ import { existsSync, readFileSync } from "node:fs"; +import { join } from "node:path"; import { rootPath } from "./config"; export function canonicalComposeEnvFile(): string { + const explicitFile = process.env.UNIDESK_COMPOSE_ENV_FILE?.trim(); + if (explicitFile) return explicitFile; + const stateDir = process.env.UNIDESK_STATE_DIR?.trim(); + if (stateDir) return join(stateDir, "docker-compose.env"); return rootPath(".state", "docker-compose.env"); }