Download tasks/hipcamp/environment/reference/clone/scripts/check-assets.mjs from TIGER-Lab/WebsiteBench: direct link, hf CLI and curl.
- Browser
- Download file 698 Bytes
-
https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/hipcamp/environment/reference/clone/scripts/check-assets.mjs
- Command line
-
hf download hf://datasets/TIGER-Lab/WebsiteBench/tasks/hipcamp/environment/reference/clone/scripts/check-assets.mjs
-
curl -L -o check-assets.mjs https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/hipcamp/environment/reference/clone/scripts/check-assets.mjs
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`); | |