copyDirSyncRecursive just deleted my whole project #50
Labels
No labels
Bug
Enhancement
Feature Request
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference: code/wrench-js#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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.
You're not a sucker :) Your library is helpful and it's open source software.
Many thanks! :D
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.
returnvsthrow, yeah, good call.As far as merging... I don't see that as predictable behavior. That's not really default behavior, is it?