-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Base for gulp.src is empty if working directory has braces #1744
Comments
Minimal repo https://github.com/heikki/gulp-1744 |
Are parentheses generally valid in filenames? Does this fall into a glob issue? I wonder if they use parens as a special character. |
Tested latest |
@stevelacy does it work with a space between |
The output from glob-stream: ``
|
Thanks @stevelacy - I'm really confused about this then. @heikki did you confirm that it's a problem or just create the repo? |
@phated repo task creates |
I'm having the same issue on Windows as our Jenkins in located in C:\Program Files (x86)\jenkins and it seems that base is evaluated to C:\ so gulp.dest then creates the full path in the destination folder (Program Files (x86)\jenkins..... ). But it seems like glob issue. Check the base of the @stevelacy test with and without brackets in the folder name: |
It seems that it is caused by isGlob and globParent implementation where isGlob evaluates such folder name as glob... // From is-glob
module.exports = function isGlob(str) {
return typeof str === 'string'
&& (/[*!?{}(|)[\]]/.test(str)
|| isExtglob(str));
};
// From glob-parent
module.exports = function globParent(str) {
str += 'a'; // preserves full path in case of trailing path separator
do {str = path.dirname(str)} while (isglob(str));
return str;
};
// From glob-stream :
var basePath = opt.base || globParent(ourGlob) + path.sep; |
I did a PR to glob-stream that basically changes when the This passes all the current tests and writes the |
Thanks to the debugging by @lukaskostial / @heikki / @stevelacy and great work by @doowb this has been fixed in v5.3.3 of glob-stream |
Relative gulp version: 4
Create any directory with brackets i.e "gulp (brackets)"
Actual result:
In directory dest we can see readme.md inside "gulp (brackets)" directory
Expected result:
In directory dest we can see readme.md file
The text was updated successfully, but these errors were encountered: