Handle correctly ignored file in multilanguages book

This commit is contained in:
Samy Pessé
2016-04-28 09:59:34 +02:00
parent 8dd5e0c250
commit 35d352bbeb
+9
View File
@@ -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)
});