diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-04-10 10:39:13 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-04-10 10:39:13 +0200 |
commit | 83ee903af43691e10153968d6bb240e6ebb1a837 (patch) | |
tree | 974e3649ffebc670b1a1f806733c5e4ab9897c71 /lib/utils | |
parent | e591b0e485ca0bc833a479c612f96d283d7ac009 (diff) | |
parent | bcc9a34742195213db21cd8e3e7b4fb1405f8d25 (diff) | |
download | gitbook-83ee903af43691e10153968d6bb240e6ebb1a837.zip gitbook-83ee903af43691e10153968d6bb240e6ebb1a837.tar.gz gitbook-83ee903af43691e10153968d6bb240e6ebb1a837.tar.bz2 |
Merge pull request #700 from paulmillr/master
Switch from gaze to chokidar.
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/watch.js | 15 |
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); }); |