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

Not triggering on hidden (dotfile) files #577

Closed
andersevenrud opened this issue Feb 7, 2017 · 3 comments
Closed

Not triggering on hidden (dotfile) files #577

andersevenrud opened this issue Feb 7, 2017 · 3 comments

Comments

@andersevenrud
Copy link

andersevenrud commented Feb 7, 2017

Hi,

I'm having some issues with chokidar and listening with a glob-pattern. It seems that nothing happens when I manipulate files inside directories with a leading dot (aka. hidden in NIX). Example: /data/storage/** (any glob-pattern seems to fail).

However, when I just listen on /data/storage it seems to trigger exactly how I want.

Since I'm using this behind an application with dynamic/configurable paths (in which case glob patterns is really handy) this is bit of a problem.

Is this a bug, or am I simply using wrong pattern? I've tried lots of stuff, but simply can't get it to work.

An example of a path that fails under my conditions: /data/storage/anders/.something/here

Node v7.4.0
Arch Linux
@es128
Copy link
Contributor

es128 commented Feb 7, 2017

Globs ignore dotfiles by default as a feature. There is an option in micromatch to change that, but unfortunately it's not exposed through chokidar.

You could watch /data/storage as a directory instead of a glob, and then create a function for the ignored option that does the filtering you want (potentially using micromatch with the dot: true option in order to keep using the same glob patterns).

@es128 es128 closed this as completed Feb 7, 2017
@andersevenrud
Copy link
Author

That's what I though.

Thanks :)

@feifeipan
Copy link

Thanks.

ignored: mm.makeRe("node_modules|.DS_Store|pom.xml",{dot:true})

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

3 participants