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

Whitespace in path #66

Closed
electerious opened this issue May 21, 2016 · 6 comments
Closed

Whitespace in path #66

electerious opened this issue May 21, 2016 · 6 comments

Comments

@electerious
Copy link

electerious commented May 21, 2016

Hi, I'm trying to match files using the following pattern:

require('micromatch')('/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/de.ejs', [
    '/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/**/[^_]*.{html,ejs}'
]) // => []

micromatch sadly returns an empty array, which is not what I expected. After several experiments I figured out that the whitespace between "ccc" and "2016" might be the reason for it.

require('micromatch')('/Users/tobiasreich/Sites/aaa/bbb/ccc2016/src/de.ejs', [
    '/Users/tobiasreich/Sites/aaa/bbb/ccc2016/src/**/[^_]*.{html,ejs}'
]) // => ['/Users/tobiasreich/Sites/aaa/bbb/ccc2016/src/de.ejs']

Is this a problem of the pattern I'm using or an issue of micromatch? How should I deal with spaces in paths?

Node.js Version: 6.2
micromatch Version: 2.3.8

@electerious electerious changed the title Space in path Whitespace in path May 21, 2016
@jonschlinkert
Copy link
Member

Is this a problem of the pattern I'm using or an issue of micromatch? How should I deal with spaces in paths?

If it's failing on a space, that would be a bug. I'm guessing it's not just the space but a combination of the space and something else... I'll take a look, thanks for creating the issue

@jonschlinkert
Copy link
Member

jonschlinkert commented May 21, 2016

Yeah it's the brace pattern. For some reason it appears to be recognizing the whitespace as a boundary or a delimiter. I know where the problem is, I should be able to get a fix pushed up.

edit: to clarify, it's not the brace pattern that's causing the issue, it's the braces library getting tripped by some combination of things here. anyway, brb

@jonschlinkert
Copy link
Member

k, found it, and fixed it. I need to run some tests on braces and micromatch then I can push up

@jonschlinkert
Copy link
Member

please reopen if you have any more issues, thanks!

@electerious
Copy link
Author

That was fast. Thanks a lot for the quick fix!

@jonschlinkert
Copy link
Member

Any time. I always appreciate getting issues for bugs. We all get busy and it's hard to take a few min and do that sometimes, but this lib is better as a result, so thank you!

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

2 participants