(version: string)
| 83 | } |
| 84 | |
| 85 | async function fetchManifest(version: string): Promise<Manifest> { |
| 86 | const url = `https://github.com/${REPO}/releases/download/${version}/manifest.json`; |
| 87 | const res = await fetch(url, { signal: AbortSignal.timeout(10_000) }); |
| 88 | if (!res.ok) throw new CLIError(`manifest.json not found for ${version}.`, ExitCode.GENERAL); |
| 89 | return res.json() as Promise<Manifest>; |
| 90 | } |
| 91 | |
| 92 | async function verifySha256(filePath: string, expected: string): Promise<void> { |
| 93 | const { createHash } = await import('crypto'); |
no test coverage detected