summaryrefslogtreecommitdiffstats
path: root/lib/book.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-01-28 18:42:21 +0100
committerSamy Pessé <samypesse@gmail.com>2016-01-28 18:42:21 +0100
commit328c3a7d5141abdeab1488d6de8a47e62ebf48dc (patch)
treead749bb54ccf855e12efe71ef5559f8bdcc5601f /lib/book.js
parent4b465bedea94688a9adfb9136c9d2970d5496274 (diff)
downloadgitbook-328c3a7d5141abdeab1488d6de8a47e62ebf48dc.zip
gitbook-328c3a7d5141abdeab1488d6de8a47e62ebf48dc.tar.gz
gitbook-328c3a7d5141abdeab1488d6de8a47e62ebf48dc.tar.bz2
Correctly create sub-book
Diffstat (limited to 'lib/book.js')
-rw-r--r--lib/book.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/book.js b/lib/book.js
index 477283f..ce368a3 100644
--- a/lib/book.js
+++ b/lib/book.js
@@ -16,7 +16,7 @@ var Promise = require('./utils/promise');
function Book(opts) {
if (!(this instanceof Book)) return new Book(opts);
- opts = _.defaults(opts || {}, {
+ this.opts = _.defaults(opts || {}, {
fs: null,
// Root path for the book
@@ -156,11 +156,10 @@ Book.prototype.parse = function() {
// Create a new book for each language and parse it
return Promise.serie(that.langs.list(), function(lang) {
that.log.debug.ln('Preparing book for language', lang.id);
- var langBook = new Book({
- fs: that.fs,
+ var langBook = new Book(_.extend({}, that.opts, {
parent: that,
root: that.resolve(lang.id)
- });
+ }));
that.books.push(langBook);