Fix warning output
This has been broken since the progress bar addition.
This commit is contained in:
parent
411defc153
commit
b4454f8432
2 changed files with 22 additions and 11 deletions
|
|
@ -21,18 +21,23 @@ module.exports = async (cachePath, manifestPath, contentPath, book, concurrentJo
|
|||
}
|
||||
const pool = workerpool.pool(path.resolve(__dirname, "convert-worker.js"), poolOptions);
|
||||
|
||||
const warnings = [];
|
||||
await Promise.all(chapters.map(async chapter => {
|
||||
const inputPath = path.resolve(cachePath, chapter.filename);
|
||||
|
||||
const destFileName = `${path.basename(chapter.filename, ".html")}.xhtml`;
|
||||
const outputPath = path.resolve(contentPath, destFileName);
|
||||
|
||||
await pool.exec("convertChapter", [chapter, book, inputPath, outputPath]);
|
||||
warnings.push(...await pool.exec("convertChapter", [chapter, book, inputPath, outputPath]));
|
||||
|
||||
progress.increment();
|
||||
}));
|
||||
|
||||
pool.terminate();
|
||||
|
||||
for (const warning of warnings) {
|
||||
console.warn(warning);
|
||||
}
|
||||
|
||||
console.log("All chapters converted");
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue