micromatch / nanomatch

Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but without support for extended globs (extglobs), posix brackets or braces, and with complete Bash 4.3 wildcard support: ("*", "**", and "?").
https://github.com/micromatch
MIT License
96 stars 20 forks source link

How to include a file from an excluded directory? #28

Closed sebastianrath closed 3 years ago

sebastianrath commented 3 years ago

Hi everyone, I am using nanomatch with the following pattern:

nm(["subdir/file1.txt", "subdir/file2.txt"], ['**', '!subdir/**', 'subdir/file2.txt'])

Output: []
Expected: ['subdir/file2.txt']

Basically I would like to include everything (**) minus the subdir but include subdir/file2.txt. For my use case ** is very important. Is there any way I am mixing up the order or miss something? Thank you!

sebastianrath commented 3 years ago

Solved by switchting to micromatch