Skip to content

Leading dot on glob leads to unexpected results #36

@robwierzbowski

Description

@robwierzbowski

It looks like the glob and regex matchers return true on empty streams. When I run the following tasks on a directory with no scss files:

gulp.task('styles', function () {
  return gulp.src(['app/styles/*.scss'])
    .pipe($.if('*.scss', gulpDebug() ))
    .pipe(gulp.dest('.tmp/styles'))
});
gulp.task('styles', function () {
  return gulp.src(['app/styles/*.scss'])
    .pipe($.if(/scss$/, gulpDebug() ))
    .pipe(gulp.dest('.tmp/styles'))
});

gulpDebug is fired both times.

This is mostly an issue when running gulp-changed along with a task that takes a while to spin up or errors with an empty stream.

I didn't test function conditions, so not sure what happens there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions