MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / ensureBinaryExists

Function ensureBinaryExists

cli/release/index.js:450–481  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

448}
449
450async function ensureBinaryExists() {
451 const currentVersion = getCurrentVersion()
452 if (currentVersion !== null) {
453 return
454 }
455
456 const version = await getLatestVersion()
457 if (!version) {
458 console.error('❌ Failed to determine latest version')
459 console.error('Please check your internet connection and try again')
460 if (!getProxyUrl()) {
461 console.error(
462 'If you are behind a proxy, set the HTTPS_PROXY environment variable',
463 )
464 }
465 process.exit(1)
466 }
467
468 try {
469 await downloadBinary(version)
470 } catch (error) {
471 term.clearLine()
472 console.error('❌ Failed to download codebuff:', error.message)
473 console.error('Please check your internet connection and try again')
474 if (!getProxyUrl()) {
475 console.error(
476 'If you are behind a proxy, set the HTTPS_PROXY environment variable',
477 )
478 }
479 process.exit(1)
480 }
481}
482
483async function checkForUpdates(runningProcess, exitListener) {
484 try {

Callers 1

mainFunction · 0.70

Calls 4

getCurrentVersionFunction · 0.70
getLatestVersionFunction · 0.70
getProxyUrlFunction · 0.70
downloadBinaryFunction · 0.70

Tested by

no test coverage detected