diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-19 17:25:16 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-19 17:25:16 +0100 |
commit | be4d2679a4daf885a470b5f89e8e6488b0c7a820 (patch) | |
tree | 4fb8929a39254a275ed75d7bc04786fa7338cc12 /lib/book.js | |
parent | 70189a5ee2da4ae2237178e6e6630b3355857f56 (diff) | |
download | gitbook-be4d2679a4daf885a470b5f89e8e6488b0c7a820.zip gitbook-be4d2679a4daf885a470b5f89e8e6488b0c7a820.tar.gz gitbook-be4d2679a4daf885a470b5f89e8e6488b0c7a820.tar.bz2 |
Add base test for generation
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/book.js b/lib/book.js index 062e02c..73f3847 100644 --- a/lib/book.js +++ b/lib/book.js @@ -6,7 +6,9 @@ var fs = require("./utils/fs"); var Configuration = require("./configuration"); var TemplateEngine = require("./template"); var Plugin = require("./plugin"); + var parsers = require("./parsers"); +var generators = require("./generators"); var Book = function(root, options, parent) { // Root folder of the book @@ -106,14 +108,21 @@ Book.prototype.parse = function() { // Generate the output Book.prototype.generate = function() { - var that = this; + var that = this, generator; + if (that.isMultilingual()) return that.generateMultiLingual(); return Q() // Clean output folder .then(function() { - return fs.clean(that.options.output); + return fs.remove(that.options.output); + }) + + // Create generator + .then(function() { + Generator = generators[that.options.generator]; + if (!Generator) throw "Generator '"+that.options.generator+"' doesn't exist"; }); }; |