MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / findBinaryRecursively

Function findBinaryRecursively

apps/kimi-code/src/utils/process/fd-detect.ts:193–206  ·  view source on GitHub ↗
(rootDir: string, binaryName: string)

Source from the content-addressed store, hash-verified

191}
192
193function 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}

Callers 1

downloadFdFunction · 0.85

Calls 2

popMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected