This commit is contained in:
@@ -5,6 +5,8 @@ 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);
|
||||
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.mkdirSync(targetDir, { recursive: true });
|
||||
@@ -19,4 +21,8 @@ templates.forEach((templateName) => {
|
||||
fs.copyFileSync(sourcePath, targetPath);
|
||||
});
|
||||
|
||||
console.log("Route report PDF templates copied to build/upload.");
|
||||
if (fs.existsSync(appFontSourcePath)) {
|
||||
fs.copyFileSync(appFontSourcePath, path.join(targetDir, unicodeFontFile));
|
||||
}
|
||||
|
||||
console.log("Route report PDF templates and Unicode font copied to build/upload.");
|
||||
|
||||
Reference in New Issue
Block a user