( startPath: string, )
| 122 | } |
| 123 | |
| 124 | export async function findSaplingWorkspaceRoot( |
| 125 | startPath: string, |
| 126 | ): Promise<string | null> { |
| 127 | let current = resolve(startPath) |
| 128 | |
| 129 | while (true) { |
| 130 | for (const candidate of COMMIT_CLOUD_RC_CANDIDATES) { |
| 131 | if ((await readTextIfExists(join(current, candidate))) !== null) { |
| 132 | return current |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | const parent = dirname(current) |
| 137 | if (parent === current) { |
| 138 | return null |
| 139 | } |
| 140 | current = parent |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | async function getCloudStatusViaSapling(repoRoot: string): Promise<string | null> { |
| 145 | const candidates = [process.env.NCODE_HG_BINARY, 'sl'].filter( |
no test coverage detected