Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Commit

Permalink
Fixes #39
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan McGrath committed Nov 9, 2012
1 parent a4ea186 commit 2628e88
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/wrench.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,13 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) {

for(var i = 0; i < files.length; i++) {
// ignores all files or directories which match the RegExp in opts.filter
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;

if(typeof opts !== 'undefined') {
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. */
Expand Down

0 comments on commit 2628e88

Please sign in to comment.