summaryrefslogtreecommitdiffstats
path: root/lib/generators/ebook.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-23 14:10:45 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-23 14:10:45 +0100
commitdf16f3d90dc79366dd5cb30a6a91aa480397833f (patch)
tree5fce1ebb6655615bd091babeda04714ea2e6a823 /lib/generators/ebook.js
parentccd2f6ecdc17f796ff434ed89e63df4e3bee8434 (diff)
downloadgitbook-df16f3d90dc79366dd5cb30a6a91aa480397833f.zip
gitbook-df16f3d90dc79366dd5cb30a6a91aa480397833f.tar.gz
gitbook-df16f3d90dc79366dd5cb30a6a91aa480397833f.tar.bz2
Test ebook generation instead of pdf output
Diffstat (limited to 'lib/generators/ebook.js')
-rw-r--r--lib/generators/ebook.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/generators/ebook.js b/lib/generators/ebook.js
index fa5dcbd..b173c19 100644
--- a/lib/generators/ebook.js
+++ b/lib/generators/ebook.js
@@ -12,10 +12,10 @@ var Generator = function(book, format) {
BaseGenerator.apply(this, arguments);
// eBook format
- this.ebookFormat = format || "pdf";
+ this.ebookFormat = format;
// Styles to use
- this.styles = ["ebook", this.ebookFormat];
+ this.styles = _.compact(["ebook", this.ebookFormat]);
};
util.inherits(Generator, BaseGenerator);
@@ -47,6 +47,8 @@ Generator.prototype.finish = function() {
return that.writeSummary();
})
.then(function() {
+ if (!that.ebookFormat) return Q();
+
var d = Q.defer();
if (!that.options.cover && fs.existsSync(path.join(that.options.output, "cover.jpg"))) {