Skip to content

Commit

Permalink
fix: vrc-get install will install oldest version
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Jan 25, 2023
1 parent 8c416dc commit 6f0cc7b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/vpm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,11 @@ impl Environment {
) -> io::Result<Option<PackageJson>> {
let mut versions = self.find_packages(package).await?;

versions.sort_by(|a, b| a.version.cmp(&b.version));
versions.retain(|x| version.satisfies(&x.version));

Ok(versions
.into_iter()
.filter(|x| version.satisfies(&x.version))
.next())
versions.sort_by(|a, b| a.version.cmp(&b.version).reverse());

Ok(versions.into_iter().next())
}

pub async fn get_repo_sources(&self) -> io::Result<Vec<RepoSource>> {
Expand Down

0 comments on commit 6f0cc7b

Please sign in to comment.