浏览代码

Change output file name

jherve 1 年之前
父节点
当前提交
63a74b0a9f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      to_pdf.js

+ 2 - 1
to_pdf.js

@@ -64,8 +64,9 @@ if (!inputPath || !templateName || !variantName || !outputPath) {
   process.exit(1);
 }
 
+const inputDirName = inputPath.split(path.sep).at(-1);
 const dataFilePath = path.join(inputPath, `${variantName}.yaml`);
 const templatePath = path.join(inputPath, `${templateName}.pug`);
 const assetsPath = path.join(inputPath, "assets");
 
-exportRenderToPdf(dataFilePath, templatePath, assetsPath, outputPath, "resume");
+exportRenderToPdf(dataFilePath, templatePath, assetsPath, outputPath, `${inputDirName}_${variantName}`);