Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix last minute breaking windows bug ^_^

  • Loading branch information...
commit f14ba7a1004d455f30f89cf58b341572e1995928 1 parent fe0a55f
@tbranyen tbranyen authored
Showing with 9 additions and 10 deletions.
  1. +9 −10 build/node_modules/grunt/node_modules/glob-sync/index.js
View
19 build/node_modules/grunt/node_modules/glob-sync/index.js
@@ -11,6 +11,8 @@ exports.globSync = function(pattern, options) {
// Normalize pattern to absolute path
var fullPattern = path.resolve(pattern);
+ // For windows support
+ fullPattern = fullPattern.replace(/\\/g, "\/");
// Determine deepest level non-wildcard path on absolute pattern
var fullBase = findBase(fullPattern);
// Determine deepest level non-wildcard on original pattern
@@ -19,35 +21,32 @@ exports.globSync = function(pattern, options) {
// If no options specified, default to empty object
options = options || {};
+ // Add the folder to start from
+ files.push(fullBase);
+
function recurseDirectory(root) {
// Iterate over all found files in the directory
fs.readdirSync(root).forEach(function(file) {
// Ensure file path is absolute
file = path.join(root, file);
- // Strip off the fullBase path and join the original base for minimatch
- // testing later on.
- var normalize = base + file.slice(fullBase.length);
-
// Recurse if found a new directory
if (fs.statSync(file).isDirectory()) {
// Need to add a trailing slash for directories
- files.push(normalize + "/");
+ files.push(file);
recurseDirectory(file);
} else {
// Add to files array to test
- files.push(normalize);
+ files.push(file);
}
});
}
- // Add the folder to start from
- files.push(base);
-
// Start recursing from the root
recurseDirectory(fullBase);
// Use @isaacs minimatch library to create a match of all the globs
- return minimatch.match(files, pattern, options);
+ return minimatch.match(files, fullPattern, options);
};
+
Please sign in to comment.
Something went wrong with that request. Please try again.