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 square brackets [] match on different OS #2436

Closed
iliyahanev opened this issue Apr 28, 2020 · 3 comments
Closed

Gulp square brackets [] match on different OS #2436

iliyahanev opened this issue Apr 28, 2020 · 3 comments

Comments

@iliyahanev
Copy link

iliyahanev commented Apr 28, 2020

This is actually not a bug, however this has taken several days of my time to find it work.

This could be used to update your docs for people who are trying to match files/folders with square brackets in their names.

// MAC / LINUX OS
function minifyJs() {
 return gulp.src('resources/\\[testFolder\\]/**/*.js') // note the \\[name\\] escape here
 .pipe(minify({ noSource: true }))
 .pipe(gulp.dest('resources/[testFolder]')) // this is working for both
}

// WINDOWS 10
function minifyJs() {
 return gulp.src('resources/[[]testFolder]/**/*.js') // note [[]name] escape here
  .pipe(minify({ noSource: true }))
  .pipe(gulp.dest('resources/[testFolder]')) // this is working for both
}

My original article in stack-overflow:
https://stackoverflow.com/questions/61442043/gulp-src-match-folder-with-square-brackets/61443677?noredirect=1#comment108764225_61443677

@phated
Copy link
Member

phated commented Apr 28, 2020

In gulp 4, we tried to normalize the escaping of globs. This shouldn't require different escape patterns.

@iliyahanev
Copy link
Author

Hello, yes, I am using the latest versions of gulp, node, npx
Windows 10
Gulp CLI version: 2.2.0
Gulp Local version: 4.0.2
Node: v10.16.0

And it still didn't work for me. This is the reason I created this because I believe there's another fan of gulp who could meet this problem and it isn't documented.

@phated
Copy link
Member

phated commented Jan 3, 2023

This will be fixed in gulp v5 via glob-stream v8. See gulpjs/glob-stream#117 for more information.

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

No branches or pull requests

2 participants