(runtime: SemanticDiffRuntime)
| 203 | } |
| 204 | |
| 205 | function semCandidates(runtime: SemanticDiffRuntime): SemCandidate[] { |
| 206 | const candidates: SemCandidate[] = []; |
| 207 | const explicit = runtime.env.PLANNOTATOR_SEM_PATH?.trim(); |
| 208 | |
| 209 | if (explicit) { |
| 210 | candidates.push({ command: explicit, source: "env", explicit: true }); |
| 211 | return candidates; |
| 212 | } |
| 213 | |
| 214 | const managed = getManagedSemBinaryPath(runtime.dataDir, runtime.platform); |
| 215 | if (runtime.fileExists(managed)) { |
| 216 | candidates.push({ command: managed, source: "managed", explicit: false }); |
| 217 | } |
| 218 | |
| 219 | candidates.push(...pathCandidates(runtime)); |
| 220 | return candidates; |
| 221 | } |
| 222 | |
| 223 | export function parseSemVersion(stdout: string): string | null { |
| 224 | const match = stdout.trim().match(/^sem\s+([0-9]+(?:\.[0-9]+){1,3}(?:[-+][^\s]+)?)/); |
no test coverage detected