File size: 736 Bytes
23883dd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | import { copyFile, mkdir, stat } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const scriptDir = dirname(fileURLToPath(import.meta.url));
const sharedRoot = resolve(scriptDir, "..");
const canonicalWorkbook = resolve(
sharedRoot,
"candidate",
"European_Gas_SnD_Start.xlsx",
);
const portalDownload = resolve(
sharedRoot,
"portal",
"public",
"downloads",
"European_Gas_SnD_Start.xlsx",
);
await stat(canonicalWorkbook);
await mkdir(dirname(portalDownload), { recursive: true });
await copyFile(canonicalWorkbook, portalDownload);
console.log(
"Synced candidate/European_Gas_SnD_Start.xlsx to portal/public/downloads/European_Gas_SnD_Start.xlsx",
);
|