diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-11 13:31:19 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-11 13:31:19 +0100 |
commit | 87d90a65ac6d1ceb5c1ce255d71713cff7dc9d17 (patch) | |
tree | 130a210e1095daafd0d9368a959c729ffe7c3839 /lib/book.js | |
parent | 02cff8c72ca742cd06a65d171657eb230eedbc5b (diff) | |
download | gitbook-87d90a65ac6d1ceb5c1ce255d71713cff7dc9d17.zip gitbook-87d90a65ac6d1ceb5c1ce255d71713cff7dc9d17.tar.gz gitbook-87d90a65ac6d1ceb5c1ce255d71713cff7dc9d17.tar.bz2 |
Stat file when parsing page
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/book.js b/lib/book.js index e762ad9..f615833 100644 --- a/lib/book.js +++ b/lib/book.js @@ -239,6 +239,12 @@ Book.prototype.readFile = function(filename) { return this.fs.readAsString(this.resolve(filename)); }; +// Get stat infos about a file +Book.prototype.statFile = function(filename) { + if (this.isFileIgnored(filename)) return Promise.reject(new error.FileNotFoundError({ filename: filename })); + return this.fs.stat(this.resolve(filename)); +}; + // Find a parsable file using a filename Book.prototype.findParsableFile = function(filename) { var that = this; |