Bladeren bron

Force input path to always have a template.pug file

jherve 1 jaar geleden
bovenliggende
commit
0006b1e749
1 gewijzigde bestanden met toevoegingen van 4 en 6 verwijderingen
  1. 4 6
      to_pdf.js

+ 4 - 6
to_pdf.js

@@ -56,17 +56,15 @@ function exportRenderToPdf(dataFilePath, templatePath, assetsPath, outputPath, o
   console.log(`Wrote PDF file to ${pdfPath}`);
 }
 
-const [inputPath, templateName, variantName, outputPath] = process.argv.slice(2);
-if (!inputPath || !templateName || !variantName || !outputPath) {
-  console.error(
-    `The script should be called like :\n${process.argv[1]} input_path template_name variant_name output_dir`
-  );
+const [inputPath, variantName, outputPath] = process.argv.slice(2);
+if (!inputPath || !variantName || !outputPath) {
+  console.error(`The script should be called like :\n${process.argv[1]} input_path variant_name output_dir`);
   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 templatePath = path.join(inputPath, `template.pug`);
 const assetsPath = path.join(inputPath, "assets");
 
 exportRenderToPdf(dataFilePath, templatePath, assetsPath, outputPath, `${inputDirName}_${variantName}`);