copyDirSyncRecursive just deleted my whole project #50

Closed
opened 2013-01-25 15:21:42 -08:00 by ricardograca · 9 comments
ricardograca commented 2013-01-25 15:21:42 -08:00 (Migrated from github.com)

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 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.
stephanebachelier commented 2013-03-01 06:51:23 -08:00 (Migrated from github.com)

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.

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.
ryanmcgrath commented 2013-05-03 13:49:20 -07:00 (Migrated from github.com)

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!

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!
stephanebachelier commented 2013-05-03 13:56:28 -07:00 (Migrated from github.com)

Glad you've made it.
You're not a sucker :) Your library is helpful and it's open source software.

Glad you've made it. You're not a sucker :) Your library is helpful and it's open source software.
ricardograca commented 2013-05-03 16:06:59 -07:00 (Migrated from github.com)

Many thanks! :D

Many thanks! :D
rabchev commented 2013-07-02 01:35:37 -07:00 (Migrated from github.com)

Now preserveFiles option is broken.

Now preserveFiles option is broken.
rabchev commented 2013-07-02 02:04:11 -07:00 (Migrated from github.com)

Sorry my bad, it works fine.

Sorry my bad, it works fine.
rabchev commented 2013-07-02 03:30:16 -07:00 (Migrated from github.com)

:) Sorry again, actually it doesn't work, I was confused. preserveFiles is really broken.

:) Sorry again, actually it doesn't work, I was confused. preserveFiles is really broken.
t-ruas commented 2013-10-21 16:40:35 -07:00 (Migrated from github.com)

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.

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.
ryanmcgrath commented 2013-10-21 19:54:25 -07:00 (Migrated from github.com)

return vs throw, yeah, good call.

As far as merging... I don't see that as predictable behavior. That's not really default behavior, is it?

`return` vs `throw`, yeah, good call. As far as merging... I don't see that as predictable behavior. That's not really default behavior, is it?
This repository is archived. You cannot comment on issues.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/wrench-js#50
No description provided.