fix
All checks were successful
Build And Deploy Main / build-and-deploy (push) Successful in 35s

This commit is contained in:
2026-03-12 13:45:39 -04:00
parent 45c8c66620
commit 66b8c3011a
3 changed files with 32 additions and 18 deletions

View File

@@ -5,8 +5,7 @@ const rootDir = path.resolve(__dirname, "..");
const sourceDir = path.join(rootDir, "public", "upload");
const targetDir = path.join(rootDir, "build", "upload");
const templates = ["pdf_templete1.pdf", "pdf_templete2.pdf", "pdf_templete3.pdf"];
const unicodeFontFile = "NotoSansCJKsc-Regular.otf";
const appFontSourcePath = path.join(rootDir, "..", "app", "assets", "fonts", unicodeFontFile);
const unicodeFontFiles = ["NotoSansSC-VF.ttf", "NotoSansCJKsc-Regular.otf"];
if (!fs.existsSync(targetDir)) {
fs.mkdirSync(targetDir, { recursive: true });
@@ -21,8 +20,11 @@ templates.forEach((templateName) => {
fs.copyFileSync(sourcePath, targetPath);
});
if (fs.existsSync(appFontSourcePath)) {
fs.copyFileSync(appFontSourcePath, path.join(targetDir, unicodeFontFile));
}
unicodeFontFiles.forEach((unicodeFontFile) => {
const appFontSourcePath = path.join(rootDir, "..", "app", "assets", "fonts", unicodeFontFile);
if (fs.existsSync(appFontSourcePath)) {
fs.copyFileSync(appFontSourcePath, path.join(targetDir, unicodeFontFile));
}
});
console.log("Route report PDF templates and Unicode font copied to build/upload.");