gulpjs / glob-stream

Readable streamx interface over anymatch.
MIT License
178 stars 53 forks source link

Base directory not copying correctly #83

Closed petedavis closed 7 years ago

petedavis commented 7 years ago

I believe it is an issue with this module.

I have two work areas, one older that has 5.3.2 installed, and the new checkout with 5.3.5 installed. One works as expected, and not the other.

In work area with 5.3.5, the issue is that the files are being copied to /tmp/src/xxxxx, and not /tmp/xxxxx

    return gulp.src('src/**/*.js')
        .pipe(eslint())
        .pipe(ngAnnotate())
        .pipe(gulp.dest(conf.path.tmp()));

Even setting the base return gulp.src('src/*/.js', {base: 'src'}) does not change the output.

Documentation clearly states for gulp that 'src/*/.js' will not contain the 'src' part of the path, and that it is using glob-stream https://gulp.readme.io/docs/gulpsrcglobs-options#section-options-base

petedavis commented 7 years ago

I have forced install of 5.3.4 npm install glob-stream@5.3.4 --save-dev to override the dependencies from gulp and this has resolved the issue.

I notice that 5.3.5 is not listed as a release on github, but is on npm https://www.npmjs.com/package/glob-stream

phated commented 7 years ago

Our tests are passing correctly. Are you sure you aren't generating that glob on Windows using a path.* method (like path.join)? We fixed a bug that you might have been relying on.

I highly recommend avoiding the readme.io docs. They are likely more out of date than the docs on the 4.0 branch of gulp (which are also very out of date).

petedavis commented 7 years ago

I have found that there is a utility method in our build scripts that does a path.join.

conf.path.tmp() is a function that can concatenate to the temp path, like conf.path.tmp('**/*.js') will return /.tmp/**/*.js using path.join.

Clearly this is the issue.

phated commented 7 years ago

Yep, you can find more information at https://github.com/gulpjs/gulp/issues/1847