(repoRoot: string)
| 142 | } |
| 143 | |
| 144 | async function getCloudStatusViaSapling(repoRoot: string): Promise<string | null> { |
| 145 | const candidates = [process.env.NCODE_HG_BINARY, 'sl'].filter( |
| 146 | (candidate): candidate is string => Boolean(candidate), |
| 147 | ) |
| 148 | |
| 149 | for (const candidate of candidates) { |
| 150 | const result = await execFileNoThrow( |
| 151 | candidate, |
| 152 | ['-R', repoRoot, 'cloud', 'status'], |
| 153 | { |
| 154 | useCwd: false, |
| 155 | timeout: 15_000, |
| 156 | }, |
| 157 | ) |
| 158 | |
| 159 | if (result.code === 0) { |
| 160 | const output = result.stdout.trim() || result.stderr.trim() |
| 161 | if (output) { |
| 162 | return output |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | return null |
| 168 | } |
| 169 | |
| 170 | export async function detectCitcWorkspaceSourceForPath( |
| 171 | startPath: string, |
nothing calls this directly
no test coverage detected