Skip to content

Commit 83ee903

Browse files
committed
Merge pull request GitbookIO#700 from paulmillr/master
Switch from gaze to chokidar.
2 parents e591b0e + bcc9a34 commit 83ee903

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

lib/utils/watch.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var Q = require('q');
22
var _ = require('lodash');
33
var path = require('path');
4-
var Gaze = require('gaze').Gaze;
4+
var chokidar = require('chokidar');
55

66
var parsers = require('gitbook-parsers')
77

@@ -17,17 +17,18 @@ function watch(dir) {
1717
toWatch.push("**/*"+ext);
1818
});
1919

20-
var gaze = new Gaze(toWatch, {
21-
cwd: dir
20+
var watcher = chokidar.watch(toWatch, {
21+
cwd: dir,
22+
ignoreInitial: true
2223
});
2324

24-
gaze.once("all", function(e, filepath) {
25-
gaze.close();
25+
watcher.once("all", function(e, filepath) {
26+
watcher.close();
2627

2728
d.resolve(filepath);
2829
});
29-
gaze.once("error", function(err) {
30-
gaze.close();
30+
watcher.once("error", function(err) {
31+
watcher.close();
3132

3233
d.reject(err);
3334
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"npmi": "0.1.1",
2222
"cheerio": "0.19.0",
2323
"gitbook-plugin-livereload": "0.0.1",
24-
"gaze": "~0.5.1",
24+
"chokidar": "~1.0.1",
2525
"send": "0.2.0",
2626
"tiny-lr": "0.1.5",
2727
"tmp": "0.0.24",

0 commit comments

Comments
 (0)