sindresorhus / gulp-filter

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

Move filters creation inside tasks in README #15

Closed hoho closed 10 years ago

hoho commented 10 years ago

Examples in README tell to create filters outside actual tasks. And it works on the first run, but on the second run (when you rerun task with gulp.watch) it throws write after end exception. It took me some time to realize that my plugin isn't the one who caused the problem.

In conclusion, I guess everything like var jsFilter = gulpFilter('**/*.js'); should be moved inside task functions in README examples.

sindresorhus commented 10 years ago

Agreed. Wanna do a PR?

hoho commented 10 years ago

Ok, I'll do it later today.

ghost commented 8 years ago

I just got bit by this today. Could we document this in the README somewhere? Or better yet, could this be changed so the filter can be created outside the task functions? It would aid in writing DRY gulp files.

mattprivman commented 8 years ago

Same here. Not only should it be in the task file, it should be directly in the scope it's used in. Encountered this problem when running a forEach/map in a gulp task.

hoho commented 8 years ago

Guys, it's the beautiful world of open source — you can fix and pull request anything :). I have fixed README a while ago, perhaps my fix is disappeared during the project's evolution (I didn't check it since then). Yet nobody stops you from fixing it again.