(name: string)
| 218 | * Resolve a managed binary. Returns its path if downloaded and version matches, or null. |
| 219 | */ |
| 220 | export function resolve(name: string): string | null { |
| 221 | const def = REGISTRY[name] |
| 222 | if (!def) return null |
| 223 | |
| 224 | const binaryPath = getBinaryPath(def) |
| 225 | if (binaryPath && fs.existsSync(binaryPath) && !needsUpgrade(name)) return binaryPath |
| 226 | return null |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Ensure a managed binary is available. Downloads if not present. |