Merge e3a696c40f into 81d7fa5cf9
This commit is contained in:
commit
653e9fc18e
1 changed files with 2 additions and 1 deletions
|
|
@ -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.'));
|
||||
|
|
|
|||
Reference in a new issue