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

basename: true and unixify: true breaks .not() #96

Closed
rogierschouten opened this issue Jul 3, 2017 · 1 comment · Fixed by #97
Closed

basename: true and unixify: true breaks .not() #96

rogierschouten opened this issue Jul 3, 2017 · 1 comment · Fixed by #97

Comments

@rogierschouten
Copy link

(Thanks for reporting an issue to micromatch! If you haven't already read the contributor guidelines, Please do that now, then procede to fill out the details below.)

Please describe the minimum necessary steps to reproduce this issue:

$ node
> let mm = require("micromatch")
undefined
> mm.not(["C:\\bla\\bar.xml"], ["*.xml"], {basename: true, unixify: true})
[ 'C:\\bla\\bar.xml' ]
> mm.not(["C:\\bla\\bar.xml"], ["*.xml"], {basename: true, unixify: false})
[]
> mm.not(["C:\\bla\\bar.xml"], ["**/*.xml"], {basename: false, unixify: true})
[ 'C:\\bla\\bar.xml' ]
> mm.not(["C:\\bla\\bar.xml"], ["**/*.xml"], {basename: false, unixify: false})
[]
>

What is happening (but shouldn't):

Specifying basename: true and unixify: true on Windows breaks the .not() function (inverts its logic)

What should be happening instead?

Specifying basename: true and unixify: true on Windows does not break the .not() function (inverts its logic)

@doowb
Copy link
Member

doowb commented Jul 3, 2017

I have a fix for this (tested on mac and windows). I'll submit a PR in a bit.

doowb added a commit that referenced this issue Jul 3, 2017
 - update .not method in the test support matcher
 - unixify the list of files passed into micromatch.not

Using utils.unixify on the list of files ensures that when the results come back, both lists
will be unixified if the unixify option is set to true.
@doowb doowb closed this as completed in #97 Jul 11, 2017
doowb added a commit that referenced this issue Jul 11, 2017
Bug fix for #96 (.not returning incorrect results on windows)
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

Successfully merging a pull request may close this issue.

2 participants