I want to create a template for our internal projects.
The layout of the project contains a variable amount of sub-folders.
I would like to specify the sub-folders to create, inside some configuration file. For example, I have the following folder structure:
my_project
|
|___ Tables
| |
| |__ Table1 <--- The folders I would like to create
| |__ Table2 <---|
| |__ Table3 <---|
|
|___ Other_folders
The configuration file should have something like this:
{
"prj_name": "my_project",
"tables": ["Table1", "Table2", "Table3"]
}
I have tried to create the following structure:
{{cookiecutter.prj_name}}
|
|___ Tables
| |
| |__ {% for table in cookiecutter.tables %}{{table}}{% endfor %}
|
|___ Other_folders
and added to cookiecutter.json
the mentioned configuration.
I ran cookiecutter using --no-input
. And the result was only a single sub-folder (Table1).
Also tried to use the following folder name: {% for table in cookiecutter.tables.keys() %}{{table}}{% endfor %}
With the following configuration:
{
"prj_name": "my_project",
"tables": {
"table1": "table1",
"table2": "table2",
"table3": "table3"
}
}
The output was still a single sub-folder (Table2Table1Table3)
Any idea how I can achieve the desired structure?