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

Refactor directory expansion. #179

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Refactor directory expansion. #179

merged 1 commit into from
Sep 12, 2024

Conversation

plietar
Copy link
Member

@plietar plietar commented Sep 11, 2024

There were three separate implementations of directory expansion spread across the codebase, each accepting slightly different inputs. The one used by orderly_resource operated over a single vector of paths. The one used by orderly_shared_resource operated over a dataframe of there/here columns. Finally the one used by orderly_copy_files used the packet metadata to enumerate files, instead of looking at the filesystem.

The three implementations are replaced by just one, which uses callbacks to determine which files are directories and to enumerate their contents. This enables it to be used either with real files on disk or off of a packet's metadata.

There were three separate implementations of directory expansion spread
across the codebase, each accepting slightly different inputs. The one
used by `orderly_resource` operated over a single vector of paths.  The
one used by `orderly_shared_resource` operated over a dataframe of
`there`/`here` columns. Finally the one used by `orderly_copy_files`
used the packet metadata to enumerate files, instead of looking at the
filesystem.

The three implementations are replaced by just one, which uses callbacks
to determine which files are directories and to enumerate their
contents. This enables it to be used either with real files on disk or
off of a packet's metadata.
Copy link
Member

@richfitz richfitz left a comment

Choose a reason for hiding this comment

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

Fabulous, thanks for harmonising that

@plietar plietar merged commit f19865c into main Sep 12, 2024
10 checks passed
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