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", );