Merge in @refaelos excludeHidden && excludeHiddenUnix patch

This commit is contained in:
Ryan McGrath 2012-11-09 05:12:39 -05:00
commit 6c90fc6e67
9 changed files with 75 additions and 2 deletions

View file

@ -187,9 +187,9 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) {
if(!opts.whitelist && opts.filter && files[i].match(opts.filter)) continue;
// if opts.whitelist is true every file or directory which doesn't match opts.filter will be ignored
if(opts.whitelist && opts.filter && !files[i].match(opts.filter)) continue;
if (opts.excludeHiddenUnix && /^\./.test(files[i])) continue;
var currFile = fs.lstatSync(sourceDir + "/" + files[i]);
if(currFile.isDirectory()) {
/* recursion this thing right on back. */
exports.copyDirSyncRecursive(sourceDir + "/" + files[i], newDirLocation + "/" + files[i], opts);