I need to copy some files then delete a sub-section of those files. Unfortunately when I use gulp-filter I'm not getting the desired results. I've reproduced the issue below. (except I'm copying the files to a second location)
gulp.task('filter', function(){
var answer = JSON.parse('{"version":"v1.0.0.19","commitHash":"e3f286806|Somg Guy|2017-08-24T19:22:59-04:00|fix","sqlFiles":["Database/Current Scripts/0101_DictionaryInsert_TaskStatus.sql","Database/Current Scripts/5000_PersonInsert.sql","Database/Stored Procedures/AddPermissionExclude.sql","Database/Stored Procedures/PaymentListForGrid.sql"]}');
var f = filter(['**/Current Scripts/*.sql'], { debug: true });
return gulp.src(answer.sqlFiles)
.pipe(gulp.dest(`.\\Database\\Archived Scripts\\v01_00\\v1.0.0.20`))
.pipe(f)
.pipe(gulp.dest(`.\\Database\\Archived Scripts\\v01_00\\v1.0.0.20_Current`));
});
Here are some things I noticed.
in the case above the first folder is populated (with 4 results) but not the second.
Then both folders are populated with results (2 results).
if I change the filter to something else like:
var f = filter(['**/*Status.sql'], { debug: true });
Then the first folder has 4 results and the second has 1 result. (expected.)
The desired behaviour in this case puts 4 files in the first folder and 2 in the second.
IssueHunt Summary
### Sponsors (Total: $20.00)
- [ issuehunt](https://issuehunt.io/u/issuehunt) ($20.00)
#### [Become a sponsor now!](https://issuehunt.io/r/sindresorhus/gulp-filter/issues/84)
#### [Or submit a pull request to get the deposits!](https://issuehunt.io/r/sindresorhus/gulp-filter/issues/84)
### 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.
I need to copy some files then delete a sub-section of those files. Unfortunately when I use gulp-filter I'm not getting the desired results. I've reproduced the issue below. (except I'm copying the files to a second location)
Here are some things I noticed.
in the case above the first folder is populated (with 4 results) but not the second.
if I rearrange the pipes like so:
Then both folders are populated with results (2 results).
var f = filter(['**/*Status.sql'], { debug: true });
Then the first folder has 4 results and the second has 1 result. (expected.)
The desired behaviour in this case puts 4 files in the first folder and 2 in the second.
IssueHunt Summary
### Sponsors (Total: $20.00) - [ issuehunt](https://issuehunt.io/u/issuehunt) ($20.00) #### [Become a sponsor now!](https://issuehunt.io/r/sindresorhus/gulp-filter/issues/84) #### [Or submit a pull request to get the deposits!](https://issuehunt.io/r/sindresorhus/gulp-filter/issues/84) ### 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.