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

Function findProjectRoot

packages/agent-core/src/skill/scanner.ts:452–461  ·  view source on GitHub ↗
(workDir: string)

Source from the content-addressed store, hash-verified

450}
451
452async function findProjectRoot(workDir: string): Promise<string> {
453 const start = path.resolve(workDir);
454 let current = start;
455 while (true) {
456 if (await exists(path.join(current, '.git'))) return current;
457 const parent = path.dirname(current);
458 if (parent === current) return start;
459 current = parent;
460 }
461}
462
463async function exists(p: string): Promise<boolean> {
464 try {

Callers 1

resolveSkillRootsFunction · 0.70

Calls 2

existsFunction · 0.70
resolveMethod · 0.65

Tested by

no test coverage detected