Comparing version 1.3.9 to 1.4.0
@@ -186,4 +186,9 @@ /* wrench.js | ||
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; | ||
var currFile = fs.lstatSync(sourceDir + "/" + files[i]); | ||
if(currFile.isDirectory()) { | ||
@@ -273,3 +278,3 @@ /* recursion this thing right on back. */ | ||
var file = dir+'/'+filename; | ||
fs.stat(file, function(err, stat){ | ||
fs.lstat(file, function(err, stat){ | ||
if (err) return clbk(err); | ||
@@ -369,2 +374,6 @@ if (stat.isDirectory()) | ||
exports.LineReader.prototype = { | ||
close: function() { | ||
return fs.closeSync(this.fd); | ||
}, | ||
getBufferAndSetCurrentPosition: function(position) { | ||
@@ -371,0 +380,0 @@ var res = fs.readSync(this.fd, this.bufferSize, position, "ascii"); |
{ | ||
"name": "wrench", | ||
"description": "Recursive filesystem (and other) operations that Node *should* have.", | ||
"version": "1.3.9", | ||
"version": "1.4.0", | ||
"author": "Ryan McGrath <ryan@venodesigns.net>", | ||
@@ -6,0 +6,0 @@ |
@@ -48,2 +48,6 @@ wrench.js - Recursive file operations in Node.js | ||
} | ||
// Note: You will need to close that above line reader at some point, otherwise | ||
// you will run into a "too many open files" error. f.close() or fs.closeSync(f.fd) are | ||
// your friends, as only you know when it is safe to close. | ||
``` | ||
@@ -58,5 +62,4 @@ | ||
}); | ||
``` | ||
Questions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath) |
@@ -10,7 +10,7 @@ var testCase = require('nodeunit').testCase; | ||
test.equals(path.existsSync(dir), false, 'Dir shouldn\'t exist - clean it up manually?'); | ||
test.equals(fs.existsSync(dir), false, 'Dir shouldn\'t exist - clean it up manually?'); | ||
wrench.mkdirSyncRecursive(dir, 0777); | ||
test.equals(path.existsSync(dir), true, 'Dir should exist now'); | ||
test.equals(fs.existsSync(dir), true, 'Dir should exist now'); | ||
@@ -17,0 +17,0 @@ // clean up |
@@ -26,3 +26,3 @@ var testCase = require('nodeunit').testCase; | ||
test.ok(path.existsSync(dir), 'Folders should exist'); | ||
test.ok(fs.existsSync(dir), 'Folders should exist'); | ||
@@ -37,3 +37,3 @@ var files = wrench.readdirSyncRecursive(dir); | ||
test.ok(path.existsSync(dir), 'Folders should exist'); | ||
test.ok(fs.existsSync(dir), 'Folders should exist'); | ||
@@ -40,0 +40,0 @@ var allFiles = []; |
@@ -6,3 +6,4 @@ // `nodeunit tests/runner` | ||
group_mkdir: require('./mkdir'), | ||
group_readdir: require('./readdir') | ||
group_readdir: require('./readdir'), | ||
group_copydir: require('./copydirsync_unix') | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21925
20
458
64
4