summaryrefslogtreecommitdiffstats
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
parent334f782aa80599f4885b531548ad8661fd475ebb (diff)
downloadgitbook-bcc9a34742195213db21cd8e3e7b4fb1405f8d25.zip
gitbook-bcc9a34742195213db21cd8e3e7b4fb1405f8d25.tar.gz
gitbook-bcc9a34742195213db21cd8e3e7b4fb1405f8d25.tar.bz2
Switch from gaze to chokidar.
-rw-r--r--lib/utils/watch.js15
-rw-r--r--package.json2
2 files changed, 9 insertions, 8 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);
});
diff --git a/package.json b/package.json
index b6303e6..ffdd98b 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
"npmi": "0.1.1",
"cheerio": "0.19.0",
"gitbook-plugin-livereload": "0.0.1",
- "gaze": "~0.5.1",
+ "chokidar": "~1.0.1",
"send": "0.2.0",
"tiny-lr": "0.1.5",
"tmp": "0.0.24",