()
| 428 | } |
| 429 | |
| 430 | async function ensureBinaryExists() { |
| 431 | const currentVersion = getCurrentVersion() |
| 432 | if (currentVersion !== null) { |
| 433 | return |
| 434 | } |
| 435 | |
| 436 | const version = await getLatestVersion() |
| 437 | if (!version) { |
| 438 | console.error('❌ Failed to determine latest version') |
| 439 | console.error('Please check your internet connection and try again') |
| 440 | if (!getProxyUrl()) { |
| 441 | console.error( |
| 442 | 'If you are behind a proxy, set the HTTPS_PROXY environment variable', |
| 443 | ) |
| 444 | } |
| 445 | process.exit(1) |
| 446 | } |
| 447 | |
| 448 | try { |
| 449 | await downloadBinary(version) |
| 450 | } catch (error) { |
| 451 | term.clearLine() |
| 452 | console.error('❌ Failed to download codecane:', error.message) |
| 453 | console.error('Please check your internet connection and try again') |
| 454 | if (!getProxyUrl()) { |
| 455 | console.error( |
| 456 | 'If you are behind a proxy, set the HTTPS_PROXY environment variable', |
| 457 | ) |
| 458 | } |
| 459 | process.exit(1) |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | async function checkForUpdates(runningProcess, exitListener) { |
| 464 | try { |
no test coverage detected