mirror of
https://github.com/lukin/keywind.git
synced 2025-01-10 09:56:25 +00:00
fix: not all files are build correctly, when execute in parallel
This commit is contained in:
parent
b24fd4c393
commit
98d89a5296
1 changed files with 19 additions and 20 deletions
|
@ -13,23 +13,22 @@ 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(
|
`mailwind --input-html ${path.join(
|
||||||
`mailwind --input-html ${path.join(
|
__dirname,
|
||||||
__dirname,
|
`../theme/keywind/email/html-src/${file}`
|
||||||
`../theme/keywind/email/html-src/${file}`
|
)} --output-html ${path.join(__dirname, `../theme/keywind/email/html/${file}`)}`
|
||||||
)} --output-html ${path.join(__dirname, `../theme/keywind/email/html/${file}`)}`
|
);
|
||||||
);
|
// 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
|
||||||
const result = data.toString()
|
.toString()
|
||||||
.replaceAll("<!--@", '</@')
|
.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);
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
);
|
|
||||||
|
|
Loading…
Reference in a new issue