-
Notifications
You must be signed in to change notification settings - Fork 71
copyDirSyncRecursive just deleted my whole project #50
Comments
I agree with this comment. The copyDirSyncRecursive should stop and warn about existiing directory it may delete. Or it should give an option to merge. A warning message may be important anyway. |
You're both right, and I'm a sucker for having to put this off for the past few months. I won't blame you if you moved on to using other libraries, but for what it's worth it should be fixed now. Errors should get thrown/returned if the directory already exists and the user hasn't specified that it should be force deleted. Thanks for filing this issue, sorry about the delay! |
Glad you've made it. |
Many thanks! :D |
Avoiding test failures by copying into a non-existent directory (see ryanmcgrath/wrench-js#50).
Now preserveFiles option is broken. |
Sorry my bad, it works fine. |
:) Sorry again, actually it doesn't work, I was confused. preserveFiles is really broken. |
You should remove that "return new Error" line (why not throw btw?) when forceDelete isn't used and just let it merge into target directory. |
As far as merging... I don't see that as predictable behavior. That's not really default behavior, is it? |
ryanmcgrath/wrench-js#50 As result, copied project failed on compilation with base.js not found message
I was trying to copy some files to the root of my project and copyDirSyncRecursive deleted my whole project. Permanently. Forever. Git directory included. Thanks for that. What I mean is that deleting the target directory should never be the default. That's not how OS copy functions work.
The text was updated successfully, but these errors were encountered: