( repoRoot: string, candidates: string[], )
| 109 | } |
| 110 | |
| 111 | async 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 | |
| 124 | export async function findSaplingWorkspaceRoot( |
| 125 | startPath: string, |
no test coverage detected