How can I exclude arbitrary file(s) with arbitrary filename extension from glob selection?
For example: we need all .pug
and .haml
files in C:\Users\User1\projectname\src\markup
except index.pug
(but index.haml
is O'K).
The glob
'C:\\Users\\User1\\projectname\\src\\markup\\!(index).+(pug|haml)'
excludes both index.pug
and index.haml
- this is not that we want, and also there is no enougnh flexibility.
Let's make clear:
- In this question we don't need to receive files by glob - the target is just create single glob selection. So the solutions like
globby(['C:\\Users\\User1\\projectname\\src\\markup\\*.+(pug|haml)', '!C:\\Users\\User1\\projectname\\src\\markup\\index.pug']);
are not matches to this question. - If it's impossible - to exclude arbitrary file(s) with arbitrary extension(s) from glob - please say such as.
I tried
minimatch(
'C:\\Users\\bokovgleb\\projectname\\src\\src\\index.pug',
'C:\\Users\\bokovgleb\\projectname\\src\\src\\*(*.pug|!(index.pug))'
)
based on comment to this answer. It returns true
...