Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulp.src with nocase: true doesn't return any file on Windows #1144

Closed
etiktin opened this issue Jul 9, 2015 · 1 comment
Closed

gulp.src with nocase: true doesn't return any file on Windows #1144

etiktin opened this issue Jul 9, 2015 · 1 comment

Comments

@etiktin
Copy link

etiktin commented Jul 9, 2015

I was trying to copy files from one folder to another and filter out some files in the process (I was moving an old grunt build task to gulp). When I use options.nocase = true no files were returned, but when it was false it did return files. Apparently this only happens on Windows.

Here's a simplified version:

    gulp.src(['**', '!Temp/**', '!*.bat'], {cwd: '../Server/', cwdbase: true, nocase: true})
        .pipe(gulp.dest('Dist/Server'))

This issue goes back months (search for nocase in node-glob). There is a fix for it at: isaacs/node-glob#146
I took the changes that @staticshock did to glob/common.js and merged them and now everything works!

If you encounter the same issue and you are using gulp@3.9.0, you can take the updated common.js from: https://gist.github.com/etiktin/ff222bb73904189a1aa7
Place it in: node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob

The node-glob maintainer (@isaacs) is taking his time with merging it (I'm not criticizing, he has his reasons). I suggest to consider replacing node-glob with a fork that adds the patch, until it's fixed upstream.

@phated
Copy link
Member

phated commented Jul 9, 2015

Thanks for pointing this out and giving others options to solve it. I don't think we will be swapping the node glob dependency for a fork.

@phated phated closed this as completed Jul 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants