@@ -163,8 +163,13 @@ function getSampleRecursive(
163
163
moduleName : string ,
164
164
sampleList : [ string , string , string , string ] [ ] ,
165
165
visited : Set < string > ,
166
- logErrors : boolean = true
166
+ logErrors : boolean = true ,
167
+ depth : number = 0 ,
168
+ maxDepth : number = 8
167
169
) {
170
+ if ( depth > maxDepth ) {
171
+ return ;
172
+ }
168
173
let realDir : string ;
169
174
try {
170
175
realDir = fs . realpathSync ( dir ) ;
@@ -229,7 +234,7 @@ function getSampleRecursive(
229
234
if ( stat . isSymbolicLink ( ) ) {
230
235
continue ;
231
236
}
232
- getSampleRecursive ( childPath , moduleName , sampleList , visited , logErrors ) ;
237
+ getSampleRecursive ( childPath , moduleName , sampleList , visited , logErrors , depth + 1 , maxDepth ) ;
233
238
}
234
239
}
235
240
}
@@ -238,8 +243,9 @@ export async function getSamples(setupState: SetupState) {
238
243
let samplefolders = await getModuleSampleFolders ( setupState ) ;
239
244
let sampleList : [ string , string , string , string ] [ ] = [ ] ;
240
245
const visited = new Set < string > ( ) ;
246
+ const maxDepth = 3 ;
241
247
for ( const folder of samplefolders ) {
242
- getSampleRecursive ( folder [ 1 ] , folder [ 0 ] , sampleList , visited ) ;
248
+ getSampleRecursive ( folder [ 1 ] , folder [ 0 ] , sampleList , visited , true , 0 , maxDepth ) ;
243
249
}
244
250
return sampleList ;
245
251
}
0 commit comments