@@ -92,16 +92,29 @@ def _create_structure(self, args):
9292 # check if content has struct value
9393 if 'struct' in content :
9494 self .logger .info (f"Generating structure in folder: { folder } with struct { content ['struct' ]} " )
95- self ._create_structure ({
96- 'structure_definition' : content ['struct' ],
97- 'base_path' : folder_path ,
98- 'structures_path' : args .structures_path ,
99- 'dry_run' : args .dry_run ,
100- 'vars' : args .vars ,
101- 'backup' : args .backup ,
102- 'file_strategy' : args .file_strategy ,
103- 'global_system_prompt' : args .global_system_prompt ,
104- })
105- self .logger .info (f"Generated structure in folder: { folder } with struct { content ['struct' ]} " )
95+ if isinstance (content ['struct' ], str ):
96+
97+ self ._create_structure ({
98+ 'structure_definition' : content ['struct' ],
99+ 'base_path' : folder_path ,
100+ 'structures_path' : args .structures_path ,
101+ 'dry_run' : args .dry_run ,
102+ 'vars' : args .vars ,
103+ 'backup' : args .backup ,
104+ 'file_strategy' : args .file_strategy ,
105+ 'global_system_prompt' : args .global_system_prompt ,
106+ })
107+ elif isinstance (content ['struct' ], list ):
108+ for struct in content ['struct' ]:
109+ self ._create_structure ({
110+ 'structure_definition' : struct ,
111+ 'base_path' : folder_path ,
112+ 'structures_path' : args .structures_path ,
113+ 'dry_run' : args .dry_run ,
114+ 'vars' : args .vars ,
115+ 'backup' : args .backup ,
116+ 'file_strategy' : args .file_strategy ,
117+ 'global_system_prompt' : args .global_system_prompt ,
118+ })
106119 else :
107120 self .logger .warning (f"Unsupported content in folder: { folder } " )
0 commit comments