(rootDir: string, binaryName: string)
| 191 | } |
| 192 | |
| 193 | function findBinaryRecursively(rootDir: string, binaryName: string): string | null { |
| 194 | const stack = [rootDir]; |
| 195 | while (stack.length > 0) { |
| 196 | const currentDir = stack.pop(); |
| 197 | if (currentDir === undefined) continue; |
| 198 | const entries = readdirSync(currentDir, { withFileTypes: true }); |
| 199 | for (const entry of entries) { |
| 200 | const fullPath = join(currentDir, entry.name); |
| 201 | if (entry.isFile() && entry.name === binaryName) return fullPath; |
| 202 | if (entry.isDirectory()) stack.push(fullPath); |
| 203 | } |
| 204 | } |
| 205 | return null; |
| 206 | } |
no test coverage detected