Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.3 kB ยท 37 lines
JavaScript
1234567891011121314151617181920212223242526272829303132333435363738#!/usr/bin/env node
import { cpSync, existsSync, mkdirSync } from "node:fs";import { dirname, join } from "node:path";import { fileURLToPath } from "node:url";
const __filename = fileURLToPath(import.meta.url);const __dirname = dirname(__filename);const ROOT_DIR = join(__dirname, "..");const DIST_PUBLIC_DIR = join(ROOT_DIR, "dist/public");const PUBLIC_DIR = join(ROOT_DIR, "public");const WEB_APP_PUBLIC_DIR = join(ROOT_DIR, "../../apps/web/public");
console.log("๐ฆ Copying registry to web app...");
// Check if the registry was built in dist/public/r or public/rlet registryDir = join(DIST_PUBLIC_DIR, "r");if (!existsSync(registryDir)) { registryDir = join(PUBLIC_DIR, "r"); if (!existsSync(registryDir)) { console.error("โ Registry not found at dist/public/r/ or public/r/"); console.error(" Run 'pnpm registry:build' first"); process.exit(1); }}
// Ensure web app public directory existsif (!existsSync(WEB_APP_PUBLIC_DIR)) { mkdirSync(WEB_APP_PUBLIC_DIR, { recursive: true });}
// Copy registry to web appconst targetDir = join(WEB_APP_PUBLIC_DIR, "r");cpSync(registryDir, targetDir, { recursive: true, force: true });
console.log(`โ
Registry copied to ${targetDir}`);console.log("๐ The registry is now available in the web app!");