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

Commit

Permalink
Resolve this merge conflict that I somehow 100% totally missed (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan McGrath committed Oct 15, 2013
1 parent 99686fb commit 5c716f9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 42 deletions.
64 changes: 23 additions & 41 deletions lib/wrench.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,30 +355,25 @@ exports.rmdirRecursive = function rmdirRecursive(dir, failSilent, clbk){
if(err && typeof failSilent === 'boolean' && !failSilent)
return clbk(err);

<<<<<<< HEAD
if(typeof failSilent === 'function')
clbk = failSilent;
=======
if(typeof failSilent === 'function')
clbk = failSilent;
>>>>>>> 7827a700ff8cb8b742e401e9876e86a63ae0c68a

(function rmFile(err){
if (err) return clbk(err);

(function rmFile(err){
if (err) return clbk(err);

var filename = files.shift();
if (filename === null || typeof filename == 'undefined')
return fs.rmdir(dir, clbk);
var filename = files.shift();
if (filename === null || typeof filename == 'undefined')
return fs.rmdir(dir, clbk);

var file = dir+'/'+filename;
fs.lstat(file, function(err, stat){
if (err) return clbk(err);
if (stat.isDirectory())
rmdirRecursive(file, rmFile);
else
fs.unlink(file, rmFile);
});
})();
var file = dir+'/'+filename;
fs.lstat(file, function(err, stat){
if (err) return clbk(err);
if (stat.isDirectory())
rmdirRecursive(file, rmFile);
else
fs.unlink(file, rmFile);
});
})();
});
};

Expand All @@ -394,31 +389,18 @@ exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, opts, clbk)
srcDir = _path.normalize(srcDir);
newDir = _path.normalize(newDir);

fs.stat(newDir, function(err, newDirStat){
fs.stat(newDir, function(err, newDirStat) {
if(!err) {
<<<<<<< HEAD
if(typeof opts !== 'undefined' && typeof opts !== 'function' && opts.forceDelete)
return exports.rmdirRecursive(newDir, function(err) {
copyDirRecursive.apply(this, originalArguments);
});
else
return clbk(new Error('You are trying to delete a directory that already exists. Specify forceDelete in an options object to override this.'));
}
if(typeof opts !== 'undefined' && typeof opts !== 'function' && opts.forceDelete)
return exports.rmdirRecursive(newDir, function(err) {
copyDirRecursive.apply(this, originalArguments);
});
else
return clbk(new Error('You are trying to delete a directory that already exists. Specify forceDelete in an options object to override this.'));
}

if(typeof opts === 'function')
clbk = opts;
=======
if(typeof opts !== 'undefined' && typeof opts !== 'function' && opts.forceDelete)
return exports.rmdirRecursive(newDir, function(err){
copyDirRecursive.apply(this, arguments);
});
else
return clbk(new Error('You are trying to delete a directory that already exists. Specify forceDelete in an options object to override this.'));
}

if(typeof opts === 'function')
clbk = opts;
>>>>>>> 7827a700ff8cb8b742e401e9876e86a63ae0c68a

fs.stat(srcDir, function(err, srcDirStat){
if (err) return clbk(err);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wrench",
"description": "Recursive filesystem (and other) operations that Node *should* have.",
"version": "1.5.3",
"version": "1.5.4",
"author": "Ryan McGrath <[email protected]>",

"repository": {
Expand Down

0 comments on commit 5c716f9

Please sign in to comment.