Closed MagmaRules closed 7 years ago
Sorry to hear this has been causing you problems. Thanks for bringing this to my attention!
The chmod()
was there to ensure the target file has the same permissions as the source file – e.g. if you have a read-only source file, you want to make sure its copy is also read-only. The same goes for executable files.
It turns out that this extra step was unnecessary, and you can just set the mode on the write stream directly, so I've updated it to do exactly that:
I've published this fix on npm as recursive-copy@2.0.7
. Feel free to close this issue if the new version solves your problem, otherwise let me know if you're still having trouble.
Works great thanks =)
No problem! Glad that fixed it for you.
This chmod call in the 'finish' event randomly fails in my project:
https://github.com/timkendrick/recursive-copy/blob/ceee5fb141af808a406a21a5f43f3c2b904e0c99/lib/copy.js#L317
If I just remove the chmod and assume it actually did the copy it works. What edge case is this trying to cover?