summaryrefslogtreecommitdiffstats
path: root/lib/utils
diff options
context:
space:
mode:
authorPaul Miller <paul@paulmillr.com>2015-04-10 06:09:04 +0300
committerPaul Miller <paul@paulmillr.com>2015-04-10 06:09:04 +0300
commitbcc9a34742195213db21cd8e3e7b4fb1405f8d25 (patch)
tree99835276de460cb5dffa88f71a6104fa804afebc /lib/utils
parent334f782aa80599f4885b531548ad8661fd475ebb (diff)
downloadgitbook-bcc9a34742195213db21cd8e3e7b4fb1405f8d25.zip
gitbook-bcc9a34742195213db21cd8e3e7b4fb1405f8d25.tar.gz
gitbook-bcc9a34742195213db21cd8e3e7b4fb1405f8d25.tar.bz2
Switch from gaze to chokidar.
Diffstat (limited to 'lib/utils')
-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);
});