MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / downloadChecksum

Function downloadChecksum

cmd/update.go:206–219  ·  view source on GitHub ↗
(release *GithubRelease, checksumFile string)

Source from the content-addressed store, hash-verified

204}
205
206func downloadChecksum(release *GithubRelease, checksumFile string) ([]byte, error) {
207 for _, asset := range release.Assets {
208 if asset.Name == checksumFile {
209 resp, err := http.Get(asset.BrowserDownloadURL)
210 if err != nil {
211 return nil, err
212 }
213 defer resp.Body.Close()
214
215 return io.ReadAll(resp.Body)
216 }
217 }
218 return nil, fmt.Errorf("checksum file not found for release")
219}
220
221func downloadAndVerifyFile(url, dest, expectedChecksum string) error {
222 // Download to memory first to verify before writing to disk

Callers 1

performUpdateFunction · 0.85

Calls 2

GetMethod · 0.80
CloseMethod · 0.80

Tested by

no test coverage detected