diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-24 12:56:26 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-24 12:56:26 +0100 |
commit | bd73c7978743329f893c1125d1645b8aa24eb7d8 (patch) | |
tree | 63a311016951e500478a39d97c30e9473f95854d /lib/book.js | |
parent | b244d506bd49526abbcfe84e2175b3410bbabb8c (diff) | |
download | gitbook-bd73c7978743329f893c1125d1645b8aa24eb7d8.zip gitbook-bd73c7978743329f893c1125d1645b8aa24eb7d8.tar.gz gitbook-bd73c7978743329f893c1125d1645b8aa24eb7d8.tar.bz2 |
Don't copy assets for each language book, but only for main book
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/book.js b/lib/book.js index 86b1d67..d8c6542 100644 --- a/lib/book.js +++ b/lib/book.js @@ -187,7 +187,10 @@ Book.prototype.parse = function() { that.books.push(langBook); - return langBook.parse(); + return langBook.parse() + .then(function() { + langBook.config.set('output', path.join(that.config.get('output'), lang.id)); + }); }); } @@ -320,10 +323,12 @@ Book.prototype.isInBook = function(filename) { // Return true if file is in the scope of a child book Book.prototype.isInLanguageBook = function(filename) { + var that = this; + return _.some(this.langs.list(), function(lang) { return pathUtil.isInRoot( - this.resolve(lang.id), - this.resolve(filename) + that.resolve(lang.id), + that.resolve(filename) ); }); }; |