AgPerry's picture
Add files using upload-large-folder tool
489b6e2 verified
Raw History Blame Contribute Delete
698 Bytes
import { existsSync, readFileSync } from "node:fs";
import { join } from "node:path";
const sourceFiles = ["app/HipcampApp.tsx", "app/globals.css"];
const pattern = /["'(](\/camps\/[^"'()]+)["')]/g;
const missing = new Set();
const seen = new Set();
for (const file of sourceFiles) {
const source = readFileSync(file, "utf8");
for (const match of source.matchAll(pattern)) {
seen.add(match[1]);
if (!existsSync(join("public", match[1]))) missing.add(match[1]);
}
}
if (missing.size) {
console.error("Missing public assets:");
for (const asset of missing) console.error(`- ${asset}`);
process.exit(1);
}
console.log(`checked ${seen.size} local camping assets, all present`);