This commit is contained in:
silverwind 2014-03-17 18:22:25 +00:00
commit af35593f0b
2 changed files with 11 additions and 10 deletions

View file

@ -11,7 +11,7 @@
* ~ Ryan McGrath (ryan [at] venodesigns.net)
*/
var fs = require("fs"),
var fs = require("graceful-fs"),
_path = require("path"),
isWindows = !!process.platform.match(/^win/);
@ -206,11 +206,11 @@ function isFileIncluded(opts, dir, filename) {
var filter = opts.filter;
if (!opts.whitelist) {
// if !opts.whitelist is false every file or directory
// if !opts.whitelist is false every file or directory
// which does match opts.filter will be ignored
return isMatch(filter) ? false : true;
} else {
// if opts.whitelist is true every file or directory
// if opts.whitelist is true every file or directory
// which doesn't match opts.filter will be ignored
return !isMatch(filter) ? false : true;
}
@ -231,7 +231,7 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) {
opts = opts || {};
try {
if(fs.statSync(newDirLocation).isDirectory()) {
if(fs.statSync(newDirLocation).isDirectory()) {
if(opts.forceDelete) {
exports.rmdirSyncRecursive(newDirLocation);
} else {
@ -262,7 +262,7 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) {
continue;
}
}
if (opts.excludeHiddenUnix && /^\./.test(files[i])) continue;
}
@ -370,12 +370,12 @@ exports.rmdirRecursive = function rmdirRecursive(dir, failSilent, clbk){
clbk = function(err) {};
fs.readdir(dir, function(err, files) {
if(err && typeof failSilent === 'boolean' && !failSilent)
if(err && typeof failSilent === 'boolean' && !failSilent)
return clbk(err);
if(typeof failSilent === 'function')
clbk = failSilent;
(function rmFile(err){
if (err) return clbk(err);

View file

@ -18,6 +18,7 @@
},
"dependencies": {
"graceful-fs": "~2.0.1"
},
"devDependencies": {
@ -26,10 +27,10 @@
"main": "./lib/wrench",
"engines": {
"node": ">=0.1.97"
"engines": {
"node": ">=0.4.0"
},
"scripts": { "test": "nodeunit tests/runner.js" },
"licenses": [{