Prevent files from the root dir of the project being copied #1448
-
Is it possible to only copy the 📁 {{project_name}} and not the rest of the template? For example: 📁 my_copier_template # your template project all files inside "my_copier_template" like the pyproject.toml will be copied to my cwd. This is something i don't want. I just want to get the project folder that i define with {{project_name}}. Is it possible to restrict this somehow? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I'm not sure I understand your problem. Why don't you want a file like |
Beta Was this translation helpful? Give feedback.
-
I think you're looking for |
Beta Was this translation helpful? Give feedback.
This is not how Copier works. See also #1322. Deriving the destination directory's name from a question is not possible with Copier, and in fact it shouldn't be because (a) a directory with the same name might already exist and (b) the local directory name doesn't matter – it's only local on your machine anyway and doesn't affect the remote repo's name/path. If Copier worked like that, applying multiple templates to the same destination directory wouldn't work.
Copier expects you to generate a project like this:
Whether
$dst
and{{project_name}}
happen to be identical or not is your choice.