summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-04-18 14:26:24 +0200
committerSamy Pessé <samypesse@gmail.com>2016-04-18 14:26:24 +0200
commit72ad872e90ffb8fcb0e33be5036b879df8311dfe (patch)
tree5c1a000de7578ab923770895dcc11896ed005c8d
parent854f244d22fab9987ae1c143dca74a1cc709b2f4 (diff)
downloadgitbook-72ad872e90ffb8fcb0e33be5036b879df8311dfe.zip
gitbook-72ad872e90ffb8fcb0e33be5036b879df8311dfe.tar.gz
gitbook-72ad872e90ffb8fcb0e33be5036b879df8311dfe.tar.bz2
Fix js error when using output without root
-rw-r--r--lib/config/index.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/config/index.js b/lib/config/index.js
index a59cbd7..6887cc2 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -93,7 +93,7 @@ Config.prototype.replace = function(options) {
});
error.deprecateField(this.options, 'generator', (this.book.output? this.book.output.name : null), '"options.generator" property is deprecated, use "output.name" instead');
- error.deprecateField(this.options, 'output', (this.book.output? this.book.output.root() : null), '"options.output" property is deprecated, use "output.root()" instead');
+ error.deprecateField(this.options, 'output', (this.book.output && this.book.output.root? this.book.output.root() : null), '"options.output" property is deprecated, use "output.root()" instead');
};
// Return true if book has a configuration file
@@ -123,7 +123,8 @@ Config.prototype.set = function(key, value) {
// Return a dump of the configuration
Config.prototype.dump = function() {
- return _.cloneDeep(this.options);
+ var opts = _.omit(this.options, 'generator', 'output');
+ return _.cloneDeep(opts);
};
// Return templating context