From 06214c5d056e76cf8455a88f3a0067e6ba6d1aa0 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Mon, 15 Apr 2019 11:19:00 +0200 Subject: [PATCH] Update to latest readdirp. --- index.js | 3 ++- lib/fsevents-handler.js | 2 -- lib/nodefs-handler.js | 2 -- test.js | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index b7e04e07..aa724fd5 100644 --- a/index.js +++ b/index.js @@ -837,7 +837,8 @@ _addPathCloser(path, closer) { list.push(closer); } -_readdirp(root, options) { +_readdirp(root, opts) { + const options = Object.assign({type: 'all', alwaysStat: true, lstat: true}, opts); let stream = readdirp(root, options); this._streams.add(stream); stream.once('close', () => { diff --git a/lib/fsevents-handler.js b/lib/fsevents-handler.js index ec94c0fc..02580c42 100644 --- a/lib/fsevents-handler.js +++ b/lib/fsevents-handler.js @@ -396,10 +396,8 @@ _addToFsEvents(path, transform, forceAdd, priorDepth) { // scan the contents of the dir this.fsw._readdirp(wh.watchPath, { - type: 'all', fileFilter: wh.filterPath, directoryFilter: wh.filterDir, - lstat: true, depth: opts.depth - (priorDepth || 0) }).on('data', (entry) => { // need to check filterPath on dirs b/c filterDir is less restrictive diff --git a/lib/nodefs-handler.js b/lib/nodefs-handler.js index 682dec41..31140b67 100644 --- a/lib/nodefs-handler.js +++ b/lib/nodefs-handler.js @@ -409,11 +409,9 @@ _handleDir(dir, stats, initialAdd, depth, target, wh, realpath, callback) { const current = new Set(); this.fsw._readdirp(directory, { - type: 'all', fileFilter: wh.filterPath, directoryFilter: wh.filterDir, depth: 0, - lstat: true }).on('data', (entry) => { const item = entry.path; let path = sysPath.join(directory, item); diff --git a/test.js b/test.js index cb9000eb..9aa082d6 100644 --- a/test.js +++ b/test.js @@ -2039,7 +2039,7 @@ describe('chokidar', function() { if (os === 'darwin') { const FsEventsHandler = require('./lib/fsevents-handler'); if (FsEventsHandler.canUse()) { - // describe('fsevents (native extension)', runTests.bind(this, {useFsEvents: true})); + describe.skip('fsevents (native extension)', runTests.bind(this, {useFsEvents: true})); } } else { }