|
|
@@ -56,12 +56,16 @@ function exportRenderToPdf(dataFilePath, templatePath, assetsPath, outputPath, o
|
|
|
console.log(`Wrote PDF file to ${pdfPath}`);
|
|
|
}
|
|
|
|
|
|
-const [dataFilePath, templatePath, assetsPath, outputPath] = process.argv.slice(2);
|
|
|
-if (!dataFilePath || !templatePath || !assetsPath || !outputPath) {
|
|
|
+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]} resume_path template_path assets_dir output_dir`
|
|
|
+ `The script should be called like :\n${process.argv[1]} input_path template_name variant_name output_dir`
|
|
|
);
|
|
|
process.exit(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");
|