From e6156219945e7027a5735035f15e00dcfe3cc8a4 Mon Sep 17 00:00:00 2001 From: Shubham Naik Date: Tue, 4 Nov 2025 11:55:21 -0800 Subject: [PATCH] Update max depth (#62) Co-authored-by: Shubham Naik --- src/cli/helpers/fileSearch.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/cli/helpers/fileSearch.ts b/src/cli/helpers/fileSearch.ts index e04da10..cac2172 100644 --- a/src/cli/helpers/fileSearch.ts +++ b/src/cli/helpers/fileSearch.ts @@ -12,12 +12,10 @@ interface FileMatch { function searchDirectoryRecursive( dir: string, pattern: string, - maxDepth: number = 3, - currentDepth: number = 0, - maxResults: number = 100, + maxResults: number = 200, results: FileMatch[] = [], ): FileMatch[] { - if (currentDepth > maxDepth || results.length >= maxResults) { + if (results.length >= maxResults) { return results; } @@ -61,14 +59,7 @@ function searchDirectoryRecursive( // Recursively search subdirectories if (stats.isDirectory()) { - searchDirectoryRecursive( - fullPath, - pattern, - maxDepth, - currentDepth + 1, - maxResults, - results, - ); + searchDirectoryRecursive(fullPath, pattern, maxResults, results); } } catch {} } @@ -116,9 +107,7 @@ export async function searchFiles( const deepResults = searchDirectoryRecursive( searchDir, searchPattern, - 3, // Max depth of 3 levels - 0, - 100, // Max 100 results + 200, // Max 200 results (no depth limit - will search all nested directories) ); results.push(...deepResults); } else {