File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
packages/cli/generators/relation Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,27 @@ module.exports = class RelationGenerator extends ArtifactGenerator {
230
230
/* istanbul ignore next */
231
231
return this . exit ( err ) ;
232
232
}
233
+ // Check if modelDir contains subdirectories
234
+ const subdirectories = await utils . getSubdirectories (
235
+ this . artifactInfo . modelDir ,
236
+ ) ;
237
+ // If subdirectories exist, retrieve models from them
238
+ if ( subdirectories . length > 0 ) {
239
+ for ( const subdirectory of subdirectories ) {
240
+ try {
241
+ const subdirectoryModelList = await utils . getArtifactList (
242
+ subdirectory ,
243
+ 'model' ,
244
+ ) ;
245
+ modelList = modelList . concat ( subdirectoryModelList ) ;
246
+ } catch ( err ) {
247
+ // Handle errors for subdirectory model retrieval
248
+ console . error (
249
+ `Error retrieving models from subdirectory ${ subdirectory } : ${ err } ` ,
250
+ ) ;
251
+ }
252
+ }
253
+ }
233
254
let repoList ;
234
255
try {
235
256
debug ( `repository list dir ${ this . artifactInfo . repoDir } ` ) ;
You can’t perform that action at this time.
0 commit comments