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

[FR]: Add option to copy_to_directory to flatten the output tree structure #756

Closed
aaronsky opened this issue Feb 13, 2024 · 1 comment
Closed
Labels
enhancement New feature or request untriaged Requires traige

Comments

@aaronsky
Copy link

What is the current behavior?

Directories input to this rule are copied while retaining the previous tree structure, which is opaque to Bazel.

Describe the feature

It would be useful for me to add a flatten field to the rule, as input to the copy_to_directory binary. This option would produce the flattened representation of the input directory tree as output, resulting in a set of files with no internal nesting.

@aaronsky aaronsky added the enhancement New feature or request label Feb 13, 2024
@github-actions github-actions bot added the untriaged Requires traige label Feb 13, 2024
@kormide
Copy link
Collaborator

kormide commented Aug 11, 2024

@aaronsky You can accomplish a flatten operation by doing:

copy_to_directory(
    name = "flattened",
    srcs = ["some_dir"],
    root_paths = ["%s/some_dir/**" % package_name()],
)

I'll close the issue assuming this addresses your use case, but if not then feel free to re-open.

@kormide kormide closed this as completed Aug 11, 2024
@github-project-automation github-project-automation bot moved this to ✅ Done in Open Source Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged Requires traige
Projects
None yet
Development

No branches or pull requests

2 participants