From 98d89a52960dc87424ec326e4a12410b8adbc7ca Mon Sep 17 00:00:00 2001 From: Paul Werner Date: Mon, 25 Sep 2023 11:12:10 +0200 Subject: [PATCH] fix: not all files are build correctly, when execute in parallel --- scripts/build.email.ts | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/scripts/build.email.ts b/scripts/build.email.ts index 9c4cf27..1e7db6a 100644 --- a/scripts/build.email.ts +++ b/scripts/build.email.ts @@ -13,23 +13,22 @@ const files = [ ...readdirSync(directoryPathComponents).map((e) => `components/atoms/${e}`), ]; -await Promise.all( - files.map(async function (file) { - if (file.includes('.ftl')) { - // Build using mailwind - await exec( - `mailwind --input-html ${path.join( - __dirname, - `../theme/keywind/email/html-src/${file}` - )} --output-html ${path.join(__dirname, `../theme/keywind/email/html/${file}`)}` - ); - // fix: wrong build result for ftl-file exception - const data = readFileSync(path.join(__dirname, `../theme/keywind/email/html/${file}`)); - const result = data.toString() - .replaceAll("", '>') - writeFileSync(path.join(__dirname, `../theme/keywind/email/html/${file}`), result); - } - }) -); +for (let file of files) { + if (file.includes('.ftl')) { + // Build using mailwind + await exec( + `mailwind --input-html ${path.join( + __dirname, + `../theme/keywind/email/html-src/${file}` + )} --output-html ${path.join(__dirname, `../theme/keywind/email/html/${file}`)}` + ); + // fix: wrong build result for ftl-file exception + const data = readFileSync(path.join(__dirname, `../theme/keywind/email/html/${file}`)); + const result = data + .toString() + .replaceAll('', '>'); + writeFileSync(path.join(__dirname, `../theme/keywind/email/html/${file}`), result); + } +}