summaryrefslogtreecommitdiffstats
path: root/lib/utils/watch.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/watch.js')
-rw-r--r--lib/utils/watch.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/utils/watch.js b/lib/utils/watch.js
index 795bbb7..b6e18e7 100644
--- a/lib/utils/watch.js
+++ b/lib/utils/watch.js
@@ -1,7 +1,7 @@
var Q = require('q');
var _ = require('lodash');
var path = require('path');
-var Gaze = require('gaze').Gaze;
+var chokidar = require('chokidar');
var parsers = require('gitbook-parsers')
@@ -17,17 +17,18 @@ function watch(dir) {
toWatch.push("**/*"+ext);
});
- var gaze = new Gaze(toWatch, {
- cwd: dir
+ var watcher = chokidar.watch(toWatch, {
+ cwd: dir,
+ ignoreInitial: true
});
- gaze.once("all", function(e, filepath) {
- gaze.close();
+ watcher.once("all", function(e, filepath) {
+ watcher.close();
d.resolve(filepath);
});
- gaze.once("error", function(err) {
- gaze.close();
+ watcher.once("error", function(err) {
+ watcher.close();
d.reject(err);
});