jatg
Version:
Just Another Template Generator
16 lines • 800 B
JavaScript
import { relative, resolve, join } from 'node:path';
import { processTemplateFile } from './processTemplateFile.js';
import { listAllFiles } from './listAllFiles.js';
export async function processTemplates(templates, variables, overwrite = false, basePath = './', ora) {
for (const template of templates) {
for (const path of template.sourcePaths) {
ora?.start(path);
const [dirPath, files] = await listAllFiles(resolve(basePath, path));
for (const inputPath of files) {
const outputPath = join(template.outputPath, relative(dirPath, inputPath));
await processTemplateFile(template, variables, inputPath, basePath, outputPath, overwrite, ora);
}
}
}
}
//# sourceMappingURL=processTemplates.js.map