MCPcopy Create free account
hub / github.com/Noumena-Network/code / findFirstExistingPath

Function findFirstExistingPath

src/utils/citcWorkspaceSource.ts:111–122  ·  view source on GitHub ↗
(
  repoRoot: string,
  candidates: string[],
)

Source from the content-addressed store, hash-verified

109}
110
111async function findFirstExistingPath(
112 repoRoot: string,
113 candidates: string[],
114): Promise<string | null> {
115 for (const candidate of candidates) {
116 const fullPath = join(repoRoot, candidate)
117 if ((await readTextIfExists(fullPath)) !== null) {
118 return fullPath
119 }
120 }
121 return null
122}
123
124export async function findSaplingWorkspaceRoot(
125 startPath: string,

Callers 1

Calls 1

readTextIfExistsFunction · 0.85

Tested by

no test coverage detected