import { readFile, access } from "node:fs/promises"; import { fileURLToPath } from "node:url"; import { dirname, join } from "node:path"; const __dirname = dirname(fileURLToPath(import.meta.url)); const ROOT = join(__dirname, ".."); const manifest = JSON.parse(await readFile(join(ROOT, "src/clips.manifest.json"), "utf8")); const missing = []; for (const c of manifest.clips) { try { await access(join(ROOT, "public", c.file)); } catch { missing.push(c.file); } } if (missing.length) { console.error(`Missing ${missing.length} clip file(s):\n ${missing.join("\n ")}`); process.exit(1); } console.log(`All ${manifest.clips.length} clip files present.`);