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

Ignored files shouldn't appear in the Watching output #27

Open
mhkeller opened this issue Feb 24, 2016 · 6 comments
Open

Ignored files shouldn't appear in the Watching output #27

mhkeller opened this issue Feb 24, 2016 · 6 comments

Comments

@mhkeller
Copy link

Chokidar properly ignores files passed in through -i but the console text will still say it is watching these files. This appears to be the relevant code: https://github.com/kimmobrunfeldt/chokidar-cli/blob/89e1310d265c4d9dfe38ff0cc5458bdf3c36b32c/index.js#L170-L176

Edit by @kimmobrunfeldt: Made the link to explicitly state a commit instead of master branch.

@kimmobrunfeldt
Copy link
Collaborator

Do you have an example of the command and it's output?

@mhkeller
Copy link
Author

Try it on here: https://github.com/mhkeller/chokidar-ignore

@kimmobrunfeldt
Copy link
Collaborator

Ok thanks. chokidar-cli is just logging all "patterns" which have been given to it for watching. In this case it seems like your terminal is doing an expansion for the pattern before chokidar-cli receives it and actually this command will be run: chokidar src/css/styles.styl src/js/main.js -i 'src/css/*.styl' -c 'npm start'

@mhkeller
Copy link
Author

Ya that's what I figured L170-176 was doing. chokidar-cli would have to get the "patterns" minus the "ignored" files back from chokidar once it runs it through anymatch or whatever it is that tests against the ignored options. Could be impossible since it would rely on chokidar to send those back.

For now maybe a note in the readme would help? I spent a bit of time thinking my path was wrong before realizing it was actually ignoring as designed.

@es128
Copy link
Collaborator

es128 commented Feb 25, 2016

Chokidar has a .getWatched() method that could be invoked after the ready event is fired to inspect all the paths that are being observed, but I don't necessarily think that's the best solution here.

I'd suggest the confusion could be avoided by just expanding the message to echo back both user inputs:

console.error('Watching', '"' + watchlist + '" and ignoring "' + ignorelist + '" ..');

@mhkeller
Copy link
Author

Ya that would certainly help.

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