question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Glob returns an empty stream

See original GitHub issue

filter(glob) returns an empty stream (no result) in this function (current glob doesn’t work):

gulp.task('views', function() {
  return gulp.src('source/views/**/*.jade')
    .pipe(filter([ '*.jade', '!{_*.jade,includes/**,_backup/**}' ]))
    .pipe(jade())
    .pipe(gulp.dest('public'))

while a nearly identical function (with a same glob) works well:

gulp.task('views', function() {
  return gulp.src('source/views/**/*.jade')
    .pipe(filter(function(file) {
      var match = multimatch([file.relative], [ '*.jade', '!{_*.jade,includes/**,_backup/**}' ])
      if (match.length)
        return file
    }))
    .pipe(jade())
    .pipe(gulp.dest('public'))

Am I doing something wrong?

“gulp”: “^3.9.1” “gulp-jade”: “^1.1.0” “gulp-filter”: “^4.0.0”

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
aicommented, Apr 12, 2016

Ouh, this simple one line in ChangeLog or GH Released may save so many time for my project 😢.

@sindresorhus it is very easy to miss some detail in big PR. ChangeLog is very important 😦.

1reaction
dargullincommented, Apr 12, 2016

@ai in 4.0 a file.relative patterns became path.relative by @cb1kenobi pr https://github.com/sindresorhus/gulp-filter/pull/59 Filter now looks into the root of your project, not a current src of your pipe https://github.com/sindresorhus/gulp-filter/pull/61

Can be fixed now by switching back to v3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python glob.glob always returns empty list - Stack Overflow
It sounds like the directory you are globbing just doesn't have .zip files in it. As a test to make sure something weird...
Read more >
StreamWrapper support for glob() · Issue #9224 - GitHub
glob () doesn't support StreamWrappers. It does surprisingly return an empty array instead of triggering an error or notice when passing a stream...
Read more >
src() - gulp.js
name type default buffer boolean function true read boolean function true since date timestamp function
Read more >
Class: Dir (Ruby 2.6.3)
Returns true if the named file is an empty directory, false if it is not a directory or non-empty.
Read more >
Bug #13276: Dir.glob returns empty array when OS has no ...
The following terminal session demonstrates how Dir.glob returns an empty array when the OS has run out of file handles; whereas File.new raises...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found