-
-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Globs don't match symlinks #530
Comments
So, as you've pointed out, there is a test covering your same exact scenario which passes on my machine and in Travis. Can you provide details such as your OS and anything else that might be noteworthy about your environment to help explain why it's different for you? |
-Edit: To be clear, I wrote the tests above and they aren't in the actual test suite. You don't have a test that covers the scenario and test above. Can you try running the first failing test above. I only saw 1 test that covers both symlinks and globs:
This would cover the |
Ah I see. Apologies, I misunderstood. Will check it out. In the meantime if you want to PR those tests you wrote, would probably be a good idea. |
I've tracked down a problem in the This only impacts the initial filtering of the readdirp scan, once this is resolved there may possibly wind up being other areas that need fixing as well for the actual event handling (but maybe not). |
Well, actually I'm uncertain if that's the right way to fix it. What happens if you set the watcher to just |
Well for my particular use case I am checking both extensions and subdirs after the symlink |
Understand, just wanted to verify you're seeing the same thing I am. Perhaps it would help if you provided a closer equivalent of your real pattern and path structure. |
I updated the original comment / tests to use .txt. |
Updated the test case to use the full example of searching a subdir after a globbed symlink. |
I am currently evaluating this patch, which so far appears to solve the problem when in fsevents mode diff --git a/index.js b/index.js
index 9841db2..af63ccc 100644
--- a/index.js
+++ b/index.js
@@ -408,6 +408,7 @@ FSWatcher.prototype._getWatchHelpers = function(path, depth) {
};
var filterPath = function(entry) {
+ if (entry.stat.isSymbolicLink()) return filterDir(entry);
var resolvedPath = entryPath(entry);
return (!hasGlob || globFilter(resolvedPath)) &&
this._isntIgnored(resolvedPath, entry.stat) && |
Awesome! Confirmed working for fsevents. |
Will this get cut into a build any time soon? |
@thetrevdev 1.6.1 is out |
If I have the paths:
I can watch
./symlink-to-origin/subdir/*.txt
but I can't watch./symlink-*/subdir/*.txt
Edit: I wrote these tests to show the specific issue and boundary cases
Passing / failing test cases:
The text was updated successfully, but these errors were encountered: