Skip to content
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

Merged

Conversation

27pchrisl
Copy link
Contributor

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.

Copy link
Member

@jcesarmobile jcesarmobile left a 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.

@27pchrisl
Copy link
Contributor Author

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.

Copy link
Member

@jcesarmobile jcesarmobile left a 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?

@27pchrisl
Copy link
Contributor Author

Behaviour updated, added 'recursive' option that defaults to false

@27pchrisl
Copy link
Contributor Author

Tests seem to be failing due to an internal CircleCI error

@jcesarmobile
Copy link
Member

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.

@27pchrisl
Copy link
Contributor Author

Conflicts fixed

Copy link
Member

@jcesarmobile jcesarmobile left a 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!

@jcesarmobile jcesarmobile changed the title feat(): Recursive rmdir feat(): Add recursive option for rmdir Aug 2, 2019
@jcesarmobile jcesarmobile merged commit 27bd601 into ionic-team:master Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants