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

Function ensureBinaryExists

cli/release-staging/index.js:430–461  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

428}
429
430async 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
463async function checkForUpdates(runningProcess, exitListener) {
464 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