MCPcopy Create free account
hub / github.com/formkit/formkit / resolveProjectRoot

Function resolveProjectRoot

packages/cli/src/skill.ts:279–286  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

277}
278
279async function resolveProjectRoot(cwd: string): Promise<string> {
280 try {
281 const result = await execa('git', ['rev-parse', '--show-toplevel'], { cwd })
282 return result.stdout.trim() || cwd
283 } catch {
284 return cwd
285 }
286}
287
288async function findNearestPackageJson(startDir: string): Promise<string | null> {
289 let current = resolve(startDir)

Callers 1

setupSkillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected