mirror of
https://github.com/jprichardson/node-fs-extra.git
synced 2026-01-25 16:42:57 +00:00
lib/_copy: fixed nasty multiple callback fs.copy() bug. Closes #98
This commit is contained in:
parent
a9b98eea42
commit
35345a330f
@ -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
|
||||
-------------------
|
||||
|
||||
17
lib/_copy.js
17
lib/_copy.js
@ -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()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user