Skip to content

Commit bd7d6cb

Browse files
committed
fix: wait for reports to be written before returning
Use Promise.all() to wait for all reports to be written before actually returning the main ace() function.
1 parent 8591a08 commit bd7d6cb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/core/ace.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ module.exports = function ace(epubPath, options) {
6363
if (options.outdir === undefined) {
6464
winston.info(JSON.stringify(report.getJsonReport(), null, ' '));
6565
} else {
66-
report.copyData(options.outdir);
67-
report.saveJson(options.outdir);
68-
report.saveHtml(options.outdir);
66+
return Promise.all([
67+
report.copyData(options.outdir),
68+
report.saveJson(options.outdir),
69+
report.saveHtml(options.outdir),
70+
]);
6971
}
7072
})
7173
.then(() => {

0 commit comments

Comments
 (0)