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

Skip processing deleted directories during sourcebundle.Build #51

Merged

Conversation

liamcervante
Copy link
Member

Previously, when building the source bundle, if an excluded directory had files in it, the build process would error because filepath.Walk computes the list of children for a directory before executing the walk function on that directory. Our function was deleting the directory (and all children) and then returning an error later when it tried to process (the now deleted) children.

Now, when we delete the directory we return the filepath.SkipDir directory which tells it to stop trying to recurse and it won't process the deleted children.

Copy link
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good to me!

There's some parallel discussion in #50 about how this strategy is also not handling exclusions that descend from already-ignored directories, which I think is separate from what you fixed here but I just want to connect the two with links in case we want to refer back to these discussions later.

@liamcervante liamcervante merged commit bc4aefe into main Nov 28, 2023
9 checks passed
@liamcervante liamcervante deleted the liamcervante/sourcebundle/skip-deleted-directories branch November 28, 2023 16:11
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