Don't pass cover to ebook-convert if non existant

This commit is contained in:
Samy Pessé
2016-02-25 15:12:04 +01:00
parent 393aed6270
commit 9253b764fa
3 changed files with 7 additions and 6 deletions
+3 -3
View File
@@ -30,6 +30,6 @@ build/Release
# Output of documentation
docs/_book
lib2
test2
theme2
book.pdf
book.epub
book.mobi
+3 -2
View File
@@ -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;
+1 -1
View File
@@ -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');