mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 10:09:04 +00:00
refactor(ncp) isWritable: simplified
This commit is contained in:
parent
517b5a7f6f
commit
9e5a44231d
1 changed files with 6 additions and 5 deletions
|
|
@ -223,11 +223,12 @@ function ncp (source, dest, options, callback) {
|
|||
|
||||
function isWritable(path, done) {
|
||||
fs.lstat(path, function (err) {
|
||||
if (err) {
|
||||
if (err.code === 'ENOENT') return done(true);
|
||||
return done(false);
|
||||
}
|
||||
return done(false);
|
||||
var result = false;
|
||||
|
||||
if (err && err.code === 'ENOENT')
|
||||
result = true;
|
||||
|
||||
done(result);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue