Create dest parent after applying filter in copy#517
Merged
Conversation
RyanZim
requested changes
Nov 9, 2017
Collaborator
There was a problem hiding this comment.
I like the idea here, however, the implementation is flawed.
Before your changes, startCopy simply checked the filter and started the copy. Now, startCopy does pathExists/mkdirp work as well. However, startCopy is called when recursively copying items in subdirectories. In those cases, the destination exists logic has already been done, so this could have a major perf hit since we're double-doing the destination checking.
Collaborator
Author
|
That's true. Let me see what I can do here! |
RyanZim
approved these changes
Nov 9, 2017
Collaborator
RyanZim
left a comment
There was a problem hiding this comment.
Looks good; please squash to one commit.
Collaborator
Author
Sure thing. |
8ca1074 to
199ec9f
Compare
Collaborator
Author
|
Squash done! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When applying filter, I think this is a little bit better than before although it still highly depends on the user's filter conditions!
But at least, if users choose their filter conditions intelligently, this way,
copy()correctly doesn't create dest parent directory since its child path fails on filter.This is until @RyanZim adds his changes for filter function.