Function
opencodeCheck
(
distro: string,
resolvedPath: string | null,
version: string | null,
expectedVersion: string,
)
Source from the content-addressed store, hash-verified
| 463 | } |
| 464 | |
| 465 | function opencodeCheck( |
| 466 | distro: string, |
| 467 | resolvedPath: string | null, |
| 468 | version: string | null, |
| 469 | expectedVersion: string, |
| 470 | ): WslOpencodeCheck { |
| 471 | if (!resolvedPath) { |
| 472 | return { |
| 473 | distro, |
| 474 | resolvedPath: null, |
| 475 | version: null, |
| 476 | expectedVersion, |
| 477 | matchesDesktop: null, |
| 478 | error: "opencode is not installed in this distro", |
| 479 | } |
| 480 | } |
| 481 | if (!version) { |
| 482 | return { |
| 483 | distro, |
| 484 | resolvedPath, |
| 485 | version: null, |
| 486 | expectedVersion, |
| 487 | matchesDesktop: null, |
| 488 | error: "opencode is installed but could not run", |
| 489 | } |
| 490 | } |
| 491 | return { |
| 492 | distro, |
| 493 | resolvedPath, |
| 494 | version, |
| 495 | expectedVersion, |
| 496 | matchesDesktop: version === expectedVersion, |
| 497 | error: null, |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | function distroProbeReady(probe: WslDistroProbe | undefined) { |
| 502 | return !!probe?.canExecute && probe.hasBash && probe.hasCurl |
Tested by
no test coverage detected