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

Request directory exclusion #58

Closed
epicblood opened this issue Oct 15, 2013 · 11 comments
Closed

Request directory exclusion #58

epicblood opened this issue Oct 15, 2013 · 11 comments

Comments

@epicblood
Copy link

Hello,
I would like to be able to wath a directory, but exclude on or a few of it's subdirectories.
Something like:
(Pseudocode)

watch C:\home\
don't watch C:\home\priv\
don't watch C:\home\default\

(sorry if you can already do this, I spent a few hours looking for it and couldn't find)

@paulmillr
Copy link
Owner

chokidar.watch('C:\home', {ignored: /C:\\home\\(priv|default)/});

@donaldpipowitch
Copy link

The Readme says Chokidar supports globs. I tried notations like !(priv|default), but it didn't work. Can you specify which sorts of globs are supported?

@es128
Copy link
Collaborator

es128 commented May 28, 2015

Don't use negated globs in ignored - it's a double-negative. Try (priv|default)/**/*

@donaldpipowitch
Copy link

Yeah, I don't want to use negated globs in ignored. I tried them in paths.

@es128
Copy link
Collaborator

es128 commented May 28, 2015

Need more details to help you diagnose the problem. What was the full set of paths/patterns you were trying to watch and what was the result?

@donaldpipowitch
Copy link

Let's say I want to use chokidar.watch('src/**/*!(_test).js'). Watch all JS files except test files. I know I can use the additional second params with ignored, but I would also expect that the glob would work.

@es128
Copy link
Collaborator

es128 commented May 28, 2015

I'll open an issue with micromatch, the underlying glob matching library for chokidar, regarding my observations using that glob pattern.

@donaldpipowitch
Copy link

Thanks, I'll watch it.

@es128
Copy link
Collaborator

es128 commented Nov 10, 2015

@donaldpipowitch you should be able to achieve the result you want by changing the pattern to src/**/?!(_test)*.js

// @jonschlinkert

@StreetStrider
Copy link

Hello. I wonder, what is the proper approach for ignoring in general? Is it negated globs in path or ignored? In my opinion, using negative paths is better, since you can formulate your intentions in a single input sequence without messing with options (additional input) at all. Does it have any downsides?

@paulmillr
Copy link
Owner

you can use either one, i'd prefer ignored by myself since it's simpler to read

taratatach pushed a commit to taratatach/chokidar that referenced this issue Oct 2, 2023
…weak

Remove travis multi-os configuration
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

5 participants