Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always fetch the most recent release, regardless of how they are sort…
Browse files Browse the repository at this point in the history
…ed (#83)
TicClick authored Feb 6, 2024
1 parent bdfba51 commit c7ee3cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/updater.rs
Original file line number Diff line number Diff line change
@@ -421,7 +421,10 @@ impl UpdaterBackend {
fn fetch_metadata_github(&self, url: &str) {
match ureq::request("GET", url).call() {
Ok(payload) => match payload.into_json::<Vec<ReleaseMetadataGitHub>>() {
Ok(releases) => {
Ok(mut releases) => {
// Descending order
releases
.sort_by(|a, b| a.tag_name.semver().cmp(&b.tag_name.semver()).reverse());
log::debug!("updater: latest release info -> {:?}", releases.first());
for release in releases {
if release.platform_specific_asset().is_some() {

0 comments on commit c7ee3cf

Please sign in to comment.