diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-05-11 12:59:16 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-05-11 13:02:24 +0200 |
commit | d5c4af337795ca5c3d4e6f516aeaef15d51c4e8c (patch) | |
tree | 3c140ee30aadb820e07003ef4ab6f89d42323ae1 /lib/parse/parseIgnore.js | |
parent | 0b4df4cdf2dc9ed18805358216439b595997fdc7 (diff) | |
download | gitbook-d5c4af337795ca5c3d4e6f516aeaef15d51c4e8c.zip gitbook-d5c4af337795ca5c3d4e6f516aeaef15d51c4e8c.tar.gz gitbook-d5c4af337795ca5c3d4e6f516aeaef15d51c4e8c.tar.bz2 |
Add immutable ignore instance for book
Diffstat (limited to 'lib/parse/parseIgnore.js')
-rw-r--r-- | lib/parse/parseIgnore.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/parse/parseIgnore.js b/lib/parse/parseIgnore.js index fafcc6f..d13663d 100644 --- a/lib/parse/parseIgnore.js +++ b/lib/parse/parseIgnore.js @@ -15,7 +15,7 @@ function parseIgnore(book) { var fs = book.getFS(); var ignore = book.getIgnore(); - ignore.addPattern([ + ignore = ignore.add([ // Skip Git stuff '.git/', @@ -35,13 +35,15 @@ function parseIgnore(book) { return Promise.serie(IGNORE_FILES, function(filename) { return fs.readAsString(filename) .then(function(content) { - ignore.addPattern(content.toString().split(/\r?\n/)); + ignore = ignore.add(content.toString().split(/\r?\n/)); }, function(err) { return Promise(); }); }) - .thenResolve(book); + .then(function() { + return book.setIgnore(ignore); + }); } module.exports = parseIgnore; |