From 9253b764fad8452fb1cf0760be482b692fdfb728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Thu, 25 Feb 2016 15:12:04 +0100 Subject: [PATCH] Don't pass cover to ebook-convert if non existant --- .gitignore | 6 +++--- lib/output/ebook.js | 5 +++-- lib/utils/command.js | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 259b0a6e4..27dec83d9 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,6 @@ build/Release # Output of documentation docs/_book -lib2 -test2 -theme2 \ No newline at end of file +book.pdf +book.epub +book.mobi diff --git a/lib/output/ebook.js b/lib/output/ebook.js index a74af415d..228a0256a 100644 --- a/lib/output/ebook.js +++ b/lib/output/ebook.js @@ -113,8 +113,9 @@ EbookOutput.prototype.locateCover = function() { cover = this.resolve(cover); // Cover doesn't exist and multilingual? - if (!fs.existsSync(cover) && this.parent) { - return this.parent.locateCover(); + if (!fs.existsSync(cover)) { + if (this.parent) return this.parent.locateCover() + else return undefined; } return cover; diff --git a/lib/utils/command.js b/lib/utils/command.js index c1689cbda..d2beba0ba 100644 --- a/lib/utils/command.js +++ b/lib/utils/command.js @@ -15,7 +15,7 @@ function exec(command, options) { var child = childProcess.exec(command, options, function(err, stdout, stderr) { if (!err) { - d.resolve(); + return d.resolve(); } err.message = stdout.toString('utf8') + stderr.toString('utf8');