Skip to content

Commit

Permalink
Hotfix; use primary file instead of the first file
Browse files Browse the repository at this point in the history
  • Loading branch information
theRookieCoder committed Apr 16, 2022
1 parent d0e05fd commit 70bc972
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog for Ferium

## [3.20.1] - 16.04.2022

When picking a file from a version, Ferium will get the primary file rather than the first file

## [3.20.0] - 16.04.2022

- Added a `Downloadable` struct that represents (and be converted from) a mod file from Modrinth, GitHub Releases, or CurseForge
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ferium"
version = "3.20.0"
version = "3.20.1"
edition = "2021"
authors = ["Ilesh Thiada (theRookieCoder) <[email protected]>", "Daniel Hauck (SolidTux)"]
description = "Ferium is a CLI program for managing Minecraft mods from Modrinth, CurseForge, and Github Releases"
Expand Down
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,14 @@ async fn actual_main() -> Result<()> {
ModIdentifier::ModrinthProject(project_id) => {
upgrade::modrinth(&modrinth, profile, project_id, no_patch_check)
.await
.map(|ok| ok.files[0].clone().into())
.map(|version| {
for file in &version.files {
if file.primary {
return file.clone().into(); // stupid `clones()`s, I WANT POLONIUS
}
}
version.files[0].clone().into() // stupid `clones()`s, I WANT POLONIUS
})
},
ModIdentifier::GitHubRepository(full_name) => {
upgrade::github(&github.repos(&full_name.0, &full_name.1), profile)
Expand Down

0 comments on commit 70bc972

Please sign in to comment.