fix(deploy): allow canonical compose env override (#799)

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-24 07:28:06 +08:00
committed by GitHub
parent 84a4b70a26
commit 6c083a4dfe
+5
View File
@@ -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");
}