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

extglob implicit * #58

Closed
arve0 opened this issue Feb 24, 2015 · 5 comments
Closed

extglob implicit * #58

arve0 opened this issue Feb 24, 2015 · 5 comments

Comments

@arve0
Copy link

arve0 commented Feb 24, 2015

In node repl:

var m = require('minimatch'),
f1 = 'name/asdf.md',
f2 = 'nameasdf/asdf.md',
f3 = 'ok/asdf.md';

pattern = '!(name)/*.md'

m(f1, pattern, {nonegate:true}) // false
m(f2, pattern, {nonegate:true}) // false
m(f3, pattern, {nonegate:true}) // true
$ grep version node_modules/minimatch/package.json 
  "version": "2.0.1",
$ node --version
v0.10.33

Is this expected?

@isaacs
Copy link
Owner

isaacs commented Feb 25, 2015

Nope. That's a bug I think.

@arve0
Copy link
Author

arve0 commented Feb 25, 2015

Adding some info:

> pattern = '!(name)/*.md'
'!(name)/*.md'
> m.Minimatch(pattern)
{ options: {},
  set: [ [ '(name)', /^(?!\.)(?=.)[^/]*?\.md$/ ] ],
  pattern: '(name)/*.md',
  regexp: null,
  negate: true,
  comment: false,
  empty: false,
  globSet: [ '(name)/*.md' ],
  globParts: [ [ '(name)', '*.md' ] ] }

@jsr6720
Copy link

jsr6720 commented May 5, 2015

Was this a confirmed bug? I'm seeing something similar with the following.

/src/js/temp/bar.js
/src/js/config/bar.js

/src/js/bar.js
/src/js/foo/bar.js

pattern 'src/js/*/.js' matces all js files as expected.

pattern 'src/js/!(config|temp)*/.js' does NOT see /src/js/bar.js

@isaacs
Copy link
Owner

isaacs commented Jul 23, 2015

@arve0 Can you see how this behaves using 2.0.10?

@arve0
Copy link
Author

arve0 commented Oct 24, 2015

This is resolved, at least in 3.0.0:

> m(f2, pattern, {nonegate:true})
true

@arve0 arve0 closed this as completed Oct 24, 2015
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

3 participants