Skip to content
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

Chokidar watcher fails if watched path contains $ character. #357

Closed
KostiantynKopytov opened this issue Sep 20, 2015 · 6 comments
Closed

Comments

@KostiantynKopytov
Copy link

I've used to keep my projects under $ folder. Just started to use chokidar, and when I pass a full path it fails to find any changes. To reproduce create /$/test/test.js:

var chokidar = require('chokidar');

chokidar.watch('/$/test/*').on('all', function(event, path) {
  console.log('absolute', event, path);
});

chokidar.watch('*').on('all', function(event, path) {
  console.log('relative', event, path);
});

Does the following output:

relative add test.js
@paulmillr
Copy link
Owner

Brunch thinks you're passing a glob pattern here. Not sure what is the best way of handling this.

@KostiantynKopytov
Copy link
Author

I guess glob pattern does not have any specific meaning for $. Regular expressions does. If regular expressions for glob are enabled, probably path should be pre-processed in some way to encode $, or other chars if needed.

@paulmillr paulmillr added the bug label Sep 21, 2015
@es128
Copy link
Collaborator

es128 commented Nov 25, 2015

If you were to watch /$/test instead of /$/test/* it would likely work (at least based on what I've observed in a quick local test. When combined with globs, I'm suspecting a bug in micromatch allowing the $ to pass in unescaped to the underlying regular expression, which of course would destroy it.

cc/ @jonschlinkert

@jonschlinkert
Copy link

This should now be fixed. Try reinstalling and let us know if you still have any issues.

@es128
Copy link
Collaborator

es128 commented Nov 25, 2015

Thanks so much @jonschlinkert! Closing the issue.

@es128 es128 closed this as completed Nov 25, 2015
@jonschlinkert
Copy link

no problem! just I wish I had seen the issue sooner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants