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

Commit

Permalink
Merge pull request #59 from aogriffiths/patch-1
Browse files Browse the repository at this point in the history
Update wrench.js
  • Loading branch information
Ryan McGrath committed Oct 15, 2013
2 parents 81d7fa5 + e3a696c commit f607440
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/wrench.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,12 @@ exports.rmdirRecursive = function rmdirRecursive(dir, failSilent, clbk){
* Note: Directories should be passed to this function without a trailing slash.
*/
exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, opts, clbk) {
var originalArguments = Array.prototype.slice.apply(arguments);
fs.stat(newDir, function(err, newDirStat){
if(!err) {
if(typeof opts !== 'undefined' && typeof opts !== 'function' && opts.forceDelete)
return exports.rmdirRecursive(newDir, function(err){
copyDirRecursive.apply(this, arguments);
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.'));
Expand Down

0 comments on commit f607440

Please sign in to comment.