Improve logs for images and ebook copy

This commit is contained in:
Samy Pessé
2015-02-04 16:54:02 +01:00
parent 65a7979874
commit 234a37726f
2 changed files with 12 additions and 12 deletions
+8 -8
View File
@@ -295,14 +295,11 @@ Book.prototype.generateFile = function(output, options) {
_tmpDir = path.join(_tmpDir, lang);
}
book.log.info("copy ebook to", output, "...");
book.log.info.ln("copy ebook to", _outputFile);
return fs.copy(
path.join(_tmpDir, "index."+options.ebookFormat),
_outputFile
)
.then(function() {
book.log.info.ok();
});
);
};
// Multi-langs book
@@ -313,12 +310,15 @@ Book.prototype.generateFile = function(output, options) {
_.map(book.langs, function(lang) {
return copyFile(lang.lang);
})
);
)
.thenResolve(book.langs.length);
} else {
return copyFile();
return copyFile().thenResolve(1);
}
})
.then(function() {
.then(function(n) {
book.log.info.ok(n+" file(s) generated");
return fs.remove(tmpDir);
});
});