Skip to content

Commit 70bc972

Browse files
Hotfix; use primary file instead of the first file
1 parent d0e05fd commit 70bc972

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog for Ferium
22

3+
## [3.20.1] - 16.04.2022
4+
5+
When picking a file from a version, Ferium will get the primary file rather than the first file
6+
37
## [3.20.0] - 16.04.2022
48

59
- Added a `Downloadable` struct that represents (and be converted from) a mod file from Modrinth, GitHub Releases, or CurseForge

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ferium"
3-
version = "3.20.0"
3+
version = "3.20.1"
44
edition = "2021"
55
authors = ["Ilesh Thiada (theRookieCoder) <[email protected]>", "Daniel Hauck (SolidTux)"]
66
description = "Ferium is a CLI program for managing Minecraft mods from Modrinth, CurseForge, and Github Releases"

src/main.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,14 @@ async fn actual_main() -> Result<()> {
215215
ModIdentifier::ModrinthProject(project_id) => {
216216
upgrade::modrinth(&modrinth, profile, project_id, no_patch_check)
217217
.await
218-
.map(|ok| ok.files[0].clone().into())
218+
.map(|version| {
219+
for file in &version.files {
220+
if file.primary {
221+
return file.clone().into(); // stupid `clones()`s, I WANT POLONIUS
222+
}
223+
}
224+
version.files[0].clone().into() // stupid `clones()`s, I WANT POLONIUS
225+
})
219226
},
220227
ModIdentifier::GitHubRepository(full_name) => {
221228
upgrade::github(&github.repos(&full_name.0, &full_name.1), profile)

0 commit comments

Comments
 (0)