mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
fix(ncp) call cb only if no case is suitable
This commit is contained in:
parent
80e08707e2
commit
e04500a9a5
1 changed files with 4 additions and 4 deletions
|
|
@ -95,13 +95,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
|
||||
|
|
@ -109,6 +107,8 @@ function ncp (source, dest, options, callback) {
|
|||
copyFile(file, target);
|
||||
else return cb();
|
||||
});
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue