I'm using gulp-zip and gulp for-each to zip a number of folders. These contain other folders named _js, _css and _raw. I wish to exclude any folder beginning with an underscore from the output zipped files.
gulp.task("zipAll", function(){
return gulp.src('src/*')
.pipe(foreach(function(stream, file){
var fileName = file.path.substr(file.path.lastIndexOf("/")+1);
gulp.src("src/" + fileName + "/**/*")
.pipe(zip(fileName + ".zip"))
.pipe(gulp.dest("dist"));
return stream;
}));
});