Show log from ebook-convert in realtime for debugging

This commit is contained in:
Samy Pessé
2015-01-28 11:52:24 +01:00
parent 324fbb2f69
commit 350f34561a
+10 -3
View File
@@ -102,9 +102,8 @@ Generator.prototype.finish = function() {
].join(" ");
that.book.log.info("start conversion to", that.ebookFormat, "....");
exec(command, function (error, stdout, stderr) {
if (stdout) that.book.log.debug.ln(stdout);
if (stderr) that.book.log.debug.ln(stderr);
var child = exec(command, function (error, stdout, stderr) {
if (error) {
that.book.log.info.fail();
@@ -120,6 +119,14 @@ Generator.prototype.finish = function() {
d.resolve();
});
child.stdout.on('data', function (data) {
that.book.log.debug(data);
});
child.stderr.on('data', function (data) {
that.book.log.debug(data);
});
return d.promise;
});
};