Download tasks/linkedin/tests/oracle-runtime/clone/scripts/prepare-standalone.mjs from TIGER-Lab/WebsiteBench: direct link, hf CLI and curl.
- Browser
- Download file 926 Bytes
-
https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/linkedin/tests/oracle-runtime/clone/scripts/prepare-standalone.mjs
- Command line
-
hf download hf://datasets/TIGER-Lab/WebsiteBench/tasks/linkedin/tests/oracle-runtime/clone/scripts/prepare-standalone.mjs
-
curl -L -o prepare-standalone.mjs https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/linkedin/tests/oracle-runtime/clone/scripts/prepare-standalone.mjs
926 Bytes
| import { cp, mkdir } from "node:fs/promises"; | |
| import { existsSync } from "node:fs"; | |
| import path from "node:path"; | |
| import { pathToFileURL } from "node:url"; | |
| export async function prepareStandalone(root = process.cwd()) { | |
| const standalone = path.join(root, ".next", "standalone"); | |
| const server = path.join(standalone, "server.js"); | |
| if (!existsSync(server)) { | |
| throw new Error("Standalone build not found. Run npm run build first."); | |
| } | |
| await mkdir(path.join(standalone, ".next"), { recursive: true }); | |
| await cp(path.join(root, ".next", "static"), path.join(standalone, ".next", "static"), { recursive: true, force: true }); | |
| if (existsSync(path.join(root, "public"))) { | |
| await cp(path.join(root, "public"), path.join(standalone, "public"), { recursive: true, force: true }); | |
| } | |
| } | |
| if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) { | |
| await prepareStandalone(); | |
| } | |