sindresorhus / gulp-filter

Filter files in a `vinyl` stream
MIT License
315 stars 37 forks source link

Fix behavior for matching paths outside cwd #92

Closed maximelkin closed 3 years ago

maximelkin commented 4 years ago

Fixes #85 (not sure, maybe #87 too) Here breaking changes: Old behavior: all paths, which is outside of current working directory, should be matched only by absolute path glob

New behavior: you can match dirs outside current working dir if you want match globally - start glob pattern with /

Removed test "should filter relative paths that leave current directory tree", because of breaking change


IssueHunt Summary ### Referenced issues This pull request has been submitted to: - [#85: Filtering files with paths outside of gulp folder not possible?](https://issuehunt.io/repos/15827909/issues/85) --- IssueHunt has been backed by the following sponsors. [Become a sponsor](https://issuehunt.io/membership/members)
maximelkin commented 4 years ago

Should be logic of detecting absolute/relative path go in minimatch instead?

sindresorhus commented 4 years ago

Sorry, seems I missed this one.

sindresorhus commented 4 years ago

Can you explain exactly what the breaking change is? What used to work and will no longer work (from a user's perspective)?

maximelkin commented 4 years ago

I will return to PR in two weeks

sindresorhus commented 3 years ago

Bump

maximelkin commented 3 years ago

Got stuck at

minimatch.match('/A/B/C/d.js', '!/**/test.js') -> false
minimatch.match('/A/C/test.js', '!/A/B/**/*.js') -> false
maximelkin commented 3 years ago

Got what, tried to exclude from empty set of files

maximelkin commented 3 years ago

@sindresorhus described changes in test cases, most of them failing on old version