robrich/gulp-if — pull request #12 by ajoslin (2014-01-23 21:39:30+00:00)
Title: fix(if): do not add child listener if match fails

I was doing this (simplified):
```js
gulp.src('src/**/*.js', 'template/**/*.html')
.pipe(gulpif(/html$/, html2js())
.pipe(concat('script.js')
.pipe(gulp.dest('dist'))
```
And I noticed I was getting duplicates in script.js. I finally figured out it was because whenever the html2js() stream emitted a `data` event, all of the non-html files would be listening for that event too and re-emit themselves as new data.

This fixes that. Only files that pass the match will listen to the child stream's data event.