Files
wehub-resource-sync 1d1286fadb
Build / Build and test (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:18:38 +08:00

17 lines
535 B
JavaScript

import { existsSync, mkdirSync, symlinkSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const source = resolve(root, "..", "docs", "assets");
const target = resolve(root, "public", "assets");
if (!existsSync(source)) {
throw new Error(`Missing shared docs assets at ${source}`);
}
if (!existsSync(target)) {
mkdirSync(dirname(target), { recursive: true });
symlinkSync(source, target, "dir");
}