Open mhkeller opened 8 years ago
Do you have an example of the command and it's output?
Try it on here: https://github.com/mhkeller/chokidar-ignore
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'
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.
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 + '" ..');
Ya that would certainly help.
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-L176Edit by @kimmobrunfeldt: Made the link to explicitly state a commit instead of master branch.