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

Incorrect deep filtering with negate patterns. #87

Closed
reklatsmasters opened this issue Mar 24, 2018 · 2 comments
Closed

Incorrect deep filtering with negate patterns. #87

reklatsmasters opened this issue Mar 24, 2018 · 2 comments
Assignees

Comments

@reklatsmasters
Copy link

Environment

  • OS Version: ubuntu 16
  • Node.js Version: 9.7.1

It's impossible to mitigate a negate pattern with a positive one. Commit 8ce21ee breaks previous behavior.

Actual behavior (after 8ce21ee)

> fg.sync(['src/*', 'src/foo/**'], { cwd, ignore: ['**/foo/**'] })
[ 'src/index.js' ]

Expected behavior (before 8ce21ee)

> fg.sync(['src/*', 'src/foo/**'], { cwd, ignore: ['**/foo/**'] })
[ 'src/index.js', 'src/foo/bar.js' ]

Steps to reproduce

There is simple folders tree:

 src
 ├── foo
 │   └── bar.js
 └── index.js

I want to have both files - index.js and bar.js. Also, i have negate pattern **/foo/**.

@mrmlnc mrmlnc self-assigned this Mar 24, 2018
@mrmlnc
Copy link
Owner

mrmlnc commented Mar 24, 2018

Hi, @reklatsmasters,

This is looks like correct behavior. You say that you want to exclude all directories from reading that match to the**/foo** pattern. But soon I will look at this issue more closely.

More information about it here:

JFYI: globby@(6|7) works the same way.

@mrmlnc mrmlnc added this to the next milestone Apr 9, 2018
@mrmlnc mrmlnc mentioned this issue Apr 9, 2018
15 tasks
@mrmlnc
Copy link
Owner

mrmlnc commented Apr 10, 2018

So, I think it's not a bug. Behavior repeats the behavior of competitors (comment above).

Thanks for the feedback, but I'm going to close this issue. Feel free to reopen if you want to discuss this point.

@mrmlnc mrmlnc closed this as completed Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants