MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / fetch_latest_beta_version

Function fetch_latest_beta_version

src/cloud.rs:216–234  ·  view source on GitHub ↗

Fetches the latest prerelease version from GitHub.

()

Source from the content-addressed store, hash-verified

214
215/// Fetches the latest prerelease version from GitHub.
216pub fn fetch_latest_beta_version() -> Option<String> {
217 let agent = agent_with_timeout(FETCH_TIMEOUT);
218 let releases: Vec<GitHubRelease> = agent
219 .get(GITHUB_RELEASES_LIST_URL)
220 .header("User-Agent", "tracedecay")
221 .call()
222 .ok()?
223 .body_mut()
224 .read_json()
225 .ok()?;
226 // First prerelease that has the current platform's asset already
227 // uploaded. GitHub returns the list newest-first, so the first match
228 // is the latest installable beta. Releases whose CI is still in
229 // progress are skipped — they will be picked up on the next check.
230 releases
231 .into_iter()
232 .find(|r| r.prerelease && release_has_current_platform_asset(r))
233 .map(|r| r.tag_name.trim_start_matches('v').to_string())
234}
235
236/// Returns true if the current build is a beta/prerelease version.
237pub fn is_beta() -> bool {

Callers 2

fetch_latest_versionFunction · 0.85
switch_channelFunction · 0.85

Calls 3

agent_with_timeoutFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected