Skip to content

Commit

Permalink
lib/_copy: fixed nasty multiple callback fs.copy() bug. Closes #98
Browse files Browse the repository at this point in the history
  • Loading branch information
jprichardson committed Jan 28, 2015
1 parent a9b98ee commit 35345a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------------
Expand Down
17 changes: 9 additions & 8 deletions lib/_copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
if(clobber) {
rmFile(target, function () {
copyFile(file, target)
})
copyFile(file, target)
} else {
if(clobber) {
rmFile(target, function () {
copyFile(file, target)
})
} else {
cb()
}
}

return cb()
})
}

Expand Down

0 comments on commit 35345a3

Please sign in to comment.