lib/_copy: fixed nasty multiple callback fs.copy() bug. Closes #98

This commit is contained in:
JP Richardson 2015-01-28 02:16:40 -06:00
parent a9b98eea42
commit 35345a330f
2 changed files with 10 additions and 8 deletions

View File

@ -3,6 +3,7 @@
- bugfix `fs.move()` into itself. Closes #104
- bugfix `fs.move()` moving directory across device. Closes #108
- added coveralls support
- bugfix: nasty multiple callback `fs.copy()` bug. Closes #98
0.15.0 / 2015-01-21
-------------------

View File

@ -82,15 +82,16 @@ function ncp (source, dest, options, callback) {
var target = file.name.replace(currentPath, targetPath)
isWritable(target, function (writable) {
if (writable) {
return copyFile(file, target)
copyFile(file, target)
} else {
if(clobber) {
rmFile(target, function () {
copyFile(file, target)
})
} else {
cb()
}
}
if(clobber) {
rmFile(target, function () {
copyFile(file, target)
})
}
return cb()
})
}