diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-28 09:59:34 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-28 09:59:34 +0200 |
commit | 35d352bbebee0b5adebf3f877342ff28e57a7a03 (patch) | |
tree | 30425b33023bbdecb18b037c6f82cd6ed5cb84e6 /lib/models | |
parent | 8dd5e0c2507fde0b423c12c4e347881fae991491 (diff) | |
download | gitbook-35d352bbebee0b5adebf3f877342ff28e57a7a03.zip gitbook-35d352bbebee0b5adebf3f877342ff28e57a7a03.tar.gz gitbook-35d352bbebee0b5adebf3f877342ff28e57a7a03.tar.bz2 |
Handle correctly ignored file in multilanguages book
Diffstat (limited to 'lib/models')
-rw-r--r-- | lib/models/book.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/models/book.js b/lib/models/book.js index 50276fa..c3096f6 100644 --- a/lib/models/book.js +++ b/lib/models/book.js @@ -121,6 +121,14 @@ Book.prototype.getContentRoot = function() { */ Book.prototype.isFileIgnored = function(filename) { var ignore = this.getIgnore(); + var language = this.getLanguage(); + + // Ignore is always relative to the root of the main book + if (language) { + filename = path.join(language, filename); + } + + return ignore.filter([filename]).length == 0; }; @@ -217,6 +225,7 @@ Book.createForFS = function createForFS(fs) { Book.createFromParent = function createFromParent(parent, language) { return new Book({ logger: parent.getLogger(), + ignore: parent.getIgnore(), language: language, fs: FS.reduceScope(parent.getFS(), language) }); |