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

Function ensureBinaryExists

freebuff/cli/release/index.js:438–469  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

436}
437
438async function ensureBinaryExists() {
439 const currentVersion = getCurrentVersion()
440 if (currentVersion !== null) {
441 return
442 }
443
444 const version = await getLatestVersion()
445 if (!version) {
446 console.error('❌ Failed to determine latest version')
447 console.error('Please check your internet connection and try again')
448 if (!getProxyUrl()) {
449 console.error(
450 'If you are behind a proxy, set the HTTPS_PROXY environment variable',
451 )
452 }
453 process.exit(1)
454 }
455
456 try {
457 await downloadBinary(version)
458 } catch (error) {
459 term.clearLine()
460 console.error('❌ Failed to download freebuff:', error.message)
461 console.error('Please check your internet connection and try again')
462 if (!getProxyUrl()) {
463 console.error(
464 'If you are behind a proxy, set the HTTPS_PROXY environment variable',
465 )
466 }
467 process.exit(1)
468 }
469}
470
471async function checkForUpdates(runningProcess, exitListener) {
472 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