Skip to content

Commit

Permalink
Merge pull request paulmillr#1197 from MarcCelani-at/handleMustScanSu…
Browse files Browse the repository at this point in the history
…bDirs

handle MustScanSubDirs
  • Loading branch information
paulmillr committed Sep 10, 2023
2 parents 399647e + 37a2eaa commit 5589454
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/constants.js
Expand Up @@ -24,6 +24,7 @@ exports.FSEVENT_DELETED = 'deleted';
exports.FSEVENT_MOVED = 'moved';
exports.FSEVENT_CLONED = 'cloned';
exports.FSEVENT_UNKNOWN = 'unknown';
exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1;
exports.FSEVENT_TYPE_FILE = 'file';
exports.FSEVENT_TYPE_DIRECTORY = 'directory';
exports.FSEVENT_TYPE_SYMLINK = 'symlink';
Expand Down
2 changes: 2 additions & 0 deletions lib/fsevents-handler.js
Expand Up @@ -37,6 +37,7 @@ const {
FSEVENT_MOVED,
// FSEVENT_CLONED,
FSEVENT_UNKNOWN,
FSEVENT_FLAG_MUST_SCAN_SUBDIRS,
FSEVENT_TYPE_FILE,
FSEVENT_TYPE_DIRECTORY,
FSEVENT_TYPE_SYMLINK,
Expand Down Expand Up @@ -148,6 +149,7 @@ function setFSEventsListener(path, realPath, listener, rawEmitter) {
rawEmitter,
watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
if (!cont.listeners.size) return;
if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return;
const info = fsevents.getInfo(fullPath, flags);
cont.listeners.forEach(list => {
list(fullPath, flags, info);
Expand Down

0 comments on commit 5589454

Please sign in to comment.