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

**/* seems to be getting the wrong regex #6

Open
mnakalay opened this issue Feb 7, 2019 · 5 comments
Open

**/* seems to be getting the wrong regex #6

mnakalay opened this issue Feb 7, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@mnakalay
Copy link

mnakalay commented Feb 7, 2019

Hello,

I am using globrex in the context of your other package tiny-glob and I think the regex generated is not correct for nested folders.

For instance I have this !(**/*.{sh,bash,bat,bin,exe,msi})

This should exclude any file with those extensions in any folder but what I'm getting instead is that it only excludes the files one folder down so for instance it will exclude /somefolder/somefile.sh but it will not exclude /somefolder/someotherfolder/somefile.sh

If I modify it to have !(**/**/*.{sh,bash,bat,bin,exe,msi}) it then removes the files only 2 folders down

So it seems instead of taking the first ** as meaning any number of nested folders, it is taking it as just one level

Thank you

@terkelg terkelg added the bug Something isn't working label Feb 8, 2019
@terkelg
Copy link
Owner

terkelg commented Feb 8, 2019

Thank you @mnakalay. I appreciate the bug reports - I'll have a look at it 👍

@terkelg
Copy link
Owner

terkelg commented Feb 8, 2019

I think this is related to terkelg/tiny-glob#28

@mnakalay
Copy link
Author

mnakalay commented Feb 9, 2019

As an FYI, I was able to work around the issue by doing *(**/)*.{sh,bash,bat,bin,exe,msi} which worked

@aleclarson
Copy link

Surprised this was never fixed. Seems like **/* is a common pattern.

aleclarson added a commit to aleclarson/vite-tsconfig-paths that referenced this issue Apr 19, 2021
otherwise, "src/**" does not match "src/a"

probably because of terkelg/globrex#6
@aleclarson
Copy link

The workaround I'm using is globstar: true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants