-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Add 'allowWindowsEscape' option #103
Conversation
+1 |
Glob pattern is a some kind of language. It SHOULD be one for any platform. |
@@ -709,7 +709,7 @@ function match (f, partial) { | |||
var options = this.options | |||
|
|||
// windows: need to use /, not \ | |||
if (path.sep !== '/') { | |||
if (!options.allowWindowsEscape && path.sep !== '/') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should still be done. Even if we aren't forcing \
to be a path separator in the pattern, we still need to make the path we're matching use /
characters.
This is a good step towards just not treating |
PR-URL: isaacs/minimatch#103 Credit: @frandiox Close: #103 Reviewed-by: @isaacs
@isaacs This is a minimum PR that fixes #50 #64 isaacs/node-glob#212 and maybe something else.
Since
node-glob
passes theoptions
object directly tominimatch
it shouldn't be necessary to updatenode-glob
. It won't break existing code either since by default this flag isundefined
. Basically if this is set, the caller have to make sure the provided string does not contain\
for path separator, only for escaping characters.