Skip to content

Commit

Permalink
handle MustScanSubDirs
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcCelani-at committed Jan 22, 2022
1 parent 4804aba commit 2720478
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/fsevents-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const {
IDENTITY_FN
} = require('./constants');

// See kFSEventStreamEventFlagMustScanSubDirs in FSEvents documentation
const MUST_SCAN_SUBDIRS_FLAG = 1;

const Depth = (value) => isNaN(value) ? {} : {depth: value};

const stat = promisify(fs.stat);
Expand Down Expand Up @@ -148,6 +151,7 @@ function setFSEventsListener(path, realPath, listener, rawEmitter) {
rawEmitter,
watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
if (!cont.listeners.size) return;
if (flags & MUST_SCAN_SUBDIRS_FLAG) return;
const info = fsevents.getInfo(fullPath, flags);
cont.listeners.forEach(list => {
list(fullPath, flags, info);
Expand Down

0 comments on commit 2720478

Please sign in to comment.