fix: not all files are build correctly, when execute in parallel

This commit is contained in:
Paul Werner 2023-09-25 11:12:10 +02:00
parent b24fd4c393
commit 98d89a5296

View file

@ -13,8 +13,7 @@ const files = [
...readdirSync(directoryPathComponents).map((e) => `components/atoms/${e}`), ...readdirSync(directoryPathComponents).map((e) => `components/atoms/${e}`),
]; ];
await Promise.all( for (let file of files) {
files.map(async function (file) {
if (file.includes('.ftl')) { if (file.includes('.ftl')) {
// Build using mailwind // Build using mailwind
await exec( await exec(
@ -25,11 +24,11 @@ await Promise.all(
); );
// fix: wrong build result for ftl-file exception // fix: wrong build result for ftl-file exception
const data = readFileSync(path.join(__dirname, `../theme/keywind/email/html/${file}`)); const data = readFileSync(path.join(__dirname, `../theme/keywind/email/html/${file}`));
const result = data.toString() const result = data
.replaceAll("<!--@", '</@') .toString()
.replaceAll("<!--#", '</#') .replaceAll('<!--@', '</@')
.replaceAll("-->", '>') .replaceAll('<!--#', '</#')
.replaceAll('-->', '>');
writeFileSync(path.join(__dirname, `../theme/keywind/email/html/${file}`), result); writeFileSync(path.join(__dirname, `../theme/keywind/email/html/${file}`), result);
} }
}) }
);