Files
AzerothAI/scripts/sites-env.mjs
T
Richard Clark 5f0fc86cf9
Core tests / core (push) Successful in 9m57s
Full verification / application (push) Failing after 5m16s
Full verification / local-brain (push) Failing after 6m15s
Realm simulation / simulated-live-world (push) Failing after 5m32s
WoW integration lab / real-worldserver (push) Canceled after 17m23s
Import verified AzerothAI snapshot from GitHub
Source branch: feature/ai-brain-router
Source commit: c2a09e0460465201a58aaab56c71424e9a96405e
2026-09-22 13:12:54 -04:00

32 lines
1.3 KiB
JavaScript

import { copyFileSync, existsSync, mkdirSync, chmodSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
export const projectRoot = fileURLToPath(new URL("../", import.meta.url));
const runtimeRoot = process.env.SITES_RUNTIME_ROOT || path.join(projectRoot, ".sites-runtime");
process.env.CLOUDFLARE_CF_FETCH_ENABLED ||= "false";
process.env.WRANGLER_SEND_METRICS ||= "false";
process.env.WRANGLER_WRITE_LOGS ||= "false";
process.env.WRANGLER_LOG_PATH ||= path.join(runtimeRoot, "wrangler/logs");
process.env.WRANGLER_REGISTRY_PATH ||= path.join(runtimeRoot, "wrangler/dev-registry");
process.env.MINIFLARE_REGISTRY_PATH ||= path.join(runtimeRoot, "wrangler/registry");
process.chdir(projectRoot);
for (const directory of [
path.dirname(process.env.WRANGLER_LOG_PATH),
process.env.WRANGLER_REGISTRY_PATH,
process.env.MINIFLARE_REGISTRY_PATH,
]) {
mkdirSync(directory, { recursive: true });
}
const rootDevVars = path.join(projectRoot, ".dev.vars");
const builtConfigDir = path.join(projectRoot, "dist/server");
const builtDevVars = path.join(builtConfigDir, ".dev.vars");
if (existsSync(rootDevVars) && existsSync(builtConfigDir)) {
copyFileSync(rootDevVars, builtDevVars);
try { chmodSync(builtDevVars, 0o600); } catch {}
}