diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-24 12:29:04 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-24 12:29:04 +0100 |
commit | c9aca86dcc10a5bc736ff363fa2195d01a37898a (patch) | |
tree | 6402c5da946a2516ab714e8c81c1f77238cc2bee /lib/utils | |
parent | 99d9d4961076424dc9681ee7f2ab2fed28d5d7c0 (diff) | |
download | gitbook-c9aca86dcc10a5bc736ff363fa2195d01a37898a.zip gitbook-c9aca86dcc10a5bc736ff363fa2195d01a37898a.tar.gz gitbook-c9aca86dcc10a5bc736ff363fa2195d01a37898a.tar.bz2 |
Watch all fiels that can be parsed in serve
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/watch.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/utils/watch.js b/lib/utils/watch.js index 715179d..795bbb7 100644 --- a/lib/utils/watch.js +++ b/lib/utils/watch.js @@ -1,12 +1,23 @@ var Q = require('q'); +var _ = require('lodash'); var path = require('path'); var Gaze = require('gaze').Gaze; +var parsers = require('gitbook-parsers') + function watch(dir) { var d = Q.defer(); dir = path.resolve(dir); - var gaze = new Gaze("**/*.md", { + var toWatch = [ + "book.json", "book.js" + ]; + + _.each(parsers.extensions, function(ext) { + toWatch.push("**/*"+ext); + }); + + var gaze = new Gaze(toWatch, { cwd: dir }); |