Skip to main content

Module update_check

Module update_check 

Source
Expand description

Check crates.io for a newer release of ebman. The check fires once at startup and writes its result to the App via an AppMsg::UpdateCheck. We don’t pull in reqwest for this — curl is already a dependency of the log-tail feature, so a one-shot subprocess fits in the same budget.

Structs§

LatestRelease
Result returned by check_async. None means “no newer release” / “couldn’t reach crates.io” / “version string didn’t parse” — anything that shouldn’t bother the user.

Enums§

InstallChannel
Channel the running binary was installed through, inferred from its path on disk. The notice in the header always says “an upgrade exists”; this is how we tell the operator what to run to apply it. None of the patterns are bulletproof — we lean on the most-common defaults and fall back to a “download from releases page” hint.

Functions§

check_async
Fire-and-forget update check. Spawns curl, parses the JSON response, and compares against CARGO_PKG_VERSION. Returns Some(latest) only when a strictly-newer semver is available. Anything that goes wrong silently maps to None.
detect_install_channel
Detect the running binary’s install channel. Best-effort; returns Standalone if we can’t read our own path.
is_newer
Semver-style ordering on dotted decimal versions. “0.2.0” > “0.1.5”. Non-numeric tails (e.g. -rc1) are sorted lexicographically as a fallback; we don’t ship pre-releases ourselves so this isn’t load-bearing.