MCPcopy Create free account
hub / github.com/blockmatic/basilic / getLatestVersion

Function getLatestVersion

scripts/setup-database.mjs:133–149  ·  view source on GitHub ↗
(repo)

Source from the content-addressed store, hash-verified

131}
132
133function getLatestVersion(repo) {
134 if (!checkCurlAvailable()) {
135 console.error('curl is required to fetch latest versions but is not installed')
136 return null
137 }
138
139 try {
140 const url = `https://api.github.com/repos/${repo}/releases/latest`
141 const response = execSync(`curl -s "${url}"`, { encoding: 'utf-8' })
142 const data = JSON.parse(response)
143 // Remove 'v' prefix if present
144 return data.tag_name.replace(/^v/, '')
145 } catch (error) {
146 console.error(`Failed to get latest version for ${repo}: ${error.message}`)
147 return null
148 }
149}
150
151function installDocker() {
152 const os = getPlatform()

Callers 1

installSupabaseFunction · 0.70

Calls 1

checkCurlAvailableFunction · 0.70

Tested by

no test coverage detected