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

Support for Creating Multiple Files from Space-Separated List Input #1847

Closed
aran159 opened this issue Nov 5, 2024 · 1 comment
Closed

Comments

@aran159
Copy link

aran159 commented Nov 5, 2024

Actual Situation

I would like to know if it's currently possible to create multiple files based on a space-separated list input using Copier's Jinja templating.

Desired Situation

For example, if I define a CLI question like this:

my_list:
  type: str
  help: "Space separated list."
  placeholder: "value_1 value_2"

I would like to create multiple files using the following Jinja syntax:

{% for item in my_list.split() %}{{ item }}{% endfor %}

This would generate two files named value_1 and value_2.

I would expect this functionality to work similarly to the conditional files and directories feature outlined here. I have been looking for tests in the repository for this specific feature but have only found tests related to conditional files and directories.

So, I am curious if this functionality is already supported. If not, does it make sense to add this feature?

Thank you!

Proposed solution

No response

@pawamoy
Copy link
Contributor

pawamoy commented Nov 5, 2024

See #1271.

@aran159 aran159 closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants