sindresorhus / gulp-filter

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

Filtering files with paths outside of gulp folder not possible? #85

Closed marcelh-gh closed 3 years ago

marcelh-gh commented 6 years ago

Issuehunt badges

hi, it seems that currently gulp-filter does not support filtering files with paths outside of the folder the gulp.task is running in. if the current behavior is desired an options to allow other paths as well would be nice (as done by del package for example). thanks & regards, Marcel


IssueHunt Summary #### [maximelkin maximelkin](https://issuehunt.io/u/maximelkin) has been rewarded. ### Backers (Total: $40.00) - [issuehunt issuehunt](https://issuehunt.io/u/issuehunt) ($40.00) ### Submitted pull Requests - [#92 fix behavior for matching paths outside cwd](https://issuehunt.io/r/sindresorhus/gulp-filter/pull/92) --- ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/sindresorhus/gulp-filter/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds.
sindresorhus commented 6 years ago

We have a test for this that proves it should work: https://github.com/sindresorhus/gulp-filter/blob/b9fb0bc5771e14b8a0c44f2a9e8daee4552c7ffd/test.js#L164 But happy to take another look if you submit a failing test.

marcelh-gh commented 6 years ago

thanks a lot for the quick response. I'm going to have a look at your tests.

I am not sure if this is relevant: I am doing this in a multi-root workspace in VS Code and I am referencing folders in another root folder ("./../otherRoot/test") But for gulp-filter these are all probably just path strings(?)

marcelh-gh commented 6 years ago

seems you can do (1) gulp.src("A/B/**/*.*").pipe(filter("A/B/**/*.xx")

but you can't do (2) gup.src("../A/B/**/*.*").pipe(filter("../A/B/**/*.xx") it just returns 0 files. no error message

case (2) only works if ".." is replaced with "**" within the filter

IssueHuntBot commented 5 years ago

@issuehunt has funded $40.00 to this issue.


issuehunt-oss[bot] commented 3 years ago

@sindresorhus has rewarded $36.00 to @maximelkin. See it on IssueHunt