diff --git a/lib/ncp.js b/lib/ncp.js index bc25a05..e243354 100644 --- a/lib/ncp.js +++ b/lib/ncp.js @@ -94,13 +94,11 @@ function ncp (source, dest, options, callback) { isWritable(target, function (writable) { if (writable) { return copyFile(file, target); - } - if(clobber) { + } else if(clobber) { rmFile(target, function () { copyFile(file, target); }); - } - if (modified) { + } else if (modified) { var stat = dereference ? fs.stat : fs.lstat; stat(target, function(err, stats) { //if souce modified time greater to target modified time copy file @@ -108,9 +106,8 @@ function ncp (source, dest, options, callback) { copyFile(file, target); else return cb(); }); - } - else { - return cb(); + } else { + cb(); } }); }