Skip to content

Commit

Permalink
Do not add symlink paths prematurely
Browse files Browse the repository at this point in the history
  • Loading branch information
es128 committed Feb 10, 2015
1 parent 553fc6f commit 3a9a5d6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/fsevents-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,18 @@ function(watchPath, realPath, transform, globFilter) {
}
} else {
if (event === 'add') {
this._getWatchedDir(parent).add(item);
if (info.type === 'directory') {
this._getWatchedDir(path);
} else if (info.type === 'symlink' && this.options.followSymlinks) {
// track new directories
if (info.type === 'directory') this._getWatchedDir(path);

if (info.type === 'symlink' && this.options.followSymlinks) {
// push symlinks back to the top of the stack to get handled
var curDepth = this.options.depth === undefined ?
undefined : depth(fullPath, realPath) + 1;
return this._addToFsEvents(path, false, true, curDepth);
} else {
// track new paths
// (other than symlinks being followed, which will be tracked soon)
this._getWatchedDir(parent).add(item);
}
}
var eventName = info.type === 'directory' ? event + 'Dir' : event;
Expand Down

0 comments on commit 3a9a5d6

Please sign in to comment.