-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(): Add recursive option for rmdir #1781
feat(): Add recursive option for rmdir #1781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, it looks good and I've tested and also works fine.
I agree that it should work the same way in all platforms, but we are deciding what the default behaviour should be, delete recursively, fail if not empty or add a new option on the rmdir command to set it to recursive or not. Will let you know once we have a final decision.
Hi, I think that it should be possible to command the native code to do the rmdir on your behalf (either with or without an option), as the performance better than the JS code doing it over the bridge. That was my motivation for making that behaviour common across platforms for our app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've decided that it should have a "recursive" option. (with that name)
So can you update this platforms to only have the new behaviour if that option is passed?
and also modify iOS to fail if the folder is not empty and no recursive option was passed?
…et and the folder has content
Behaviour updated, added 'recursive' option that defaults to false |
Tests seem to be failing due to an internal CircleCI error |
I've merged your other PR and not this one have conflicts, can you fix them? Hopefully tests will pass this time, they sometimes hang for no reason. |
Conflicts fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed 2 minor changes and 2 fixes to your branch, will merge once tests finish.
Thanks again for your PR!
Filesystem.rmdir has different behaviour on iOS to other platforms (deletes recursively on iOS, does not on other platforms). This addresses the inconsistency by making all platforms delete recursively.