|
|
@@ -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}`);
|