Skip to content

Commit 3330cde

Browse files
Fix #60, some other small list verbose tweaks
1 parent 55379c4 commit 3330cde

File tree

6 files changed

+46
-18
lines changed

6 files changed

+46
-18
lines changed

CHANGELOG.md

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

3+
## `v3.28.4`
4+
### 11.05.2022
5+
6+
- Added project id to list verbose and some other small tweaks
7+
- Upgrading now deletes old files if moving the file failed (e.g. if it's already in `.old`)
8+
- This fixes [#60](https://github.com/theRookieCoder/ferium/issues/60)
9+
310
## `v3.28.3`
11+
### 11.05.2022
412

513
- Update to Libium 1.14
614
- This fixes [#53](https://github.com/theRookieCoder/ferium/issues/53)
@@ -10,6 +18,7 @@
1018
- Significantly improved verbose listing to be more colourful, consistent, and informative
1119

1220
## `v3.28.2`
21+
### 09.05.2022
1322

1423
- Update to Libium 1.12
1524
- Improved upgrade code to be faster and more clean

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.28.3"
3+
version = "3.28.4"
44
edition = "2021"
55
authors = ["Ilesh Thiada (theRookieCoder) <[email protected]>", "薛詠謙 (KyleUltimate)", "Daniel Hauck (SolidTux)"]
66
description = "Ferium is a CLI program for managing Minecraft mods from Modrinth, CurseForge, and Github Releases"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ Ferium is coming to more package managers soon!
3131

3232
Ferium releases a no-gui version [here](https://aur.archlinux.org/packages/ferium-bin) and a version with a GUI file dialog [here](https://aur.archlinux.org/packages/ferium-gui-bin). The GUI version dependes on GTK
3333

34+
### Scoop
35+
36+
Ferium releases [here](https://scoop.sh/#/apps?q=ferium) in Scoop's official games bucket. Run `scoop bucket add games` then `scoop install ferium` to install Ferium.
37+
3438
### Cargo Install
3539

3640
If you have the Rust toolchain, you can also compile and install Ferium by running `cargo install ferium`.

src/subcommands/list.rs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ pub async fn curseforge(curseforge: Arc<Furse>, project_id: i32) -> Result<()> {
1212
"{}
1313
\r {}\n
1414
\r Link: {}
15-
\r Source: CurseForge Mod
15+
\r Source: {}
16+
\r Project ID: {}
1617
\r Open Source: {}
1718
\r Downloads: {}
1819
\r Authors: {}
1920
\r Categories: {}
2021
",
21-
project.name.bold().italic(),
22-
project.summary.trim(),
22+
project.name.bold(),
23+
project.summary.trim().italic(),
2324
project.links.website_url.blue(),
25+
"CurseForge Mod".dimmed(),
26+
project.id.to_string().dimmed(),
2427
project.links.source_url.map_or("No".red(), |url| format!(
2528
"Yes ({})",
2629
url.blue().underline()
@@ -54,18 +57,21 @@ pub async fn modrinth(modrinth: Arc<Ferinth>, project_id: String) -> Result<()>
5457
"{}
5558
\r {}\n
5659
\r Link: {}
57-
\r Source: Modrinth Mod
60+
\r Source: {}
61+
\r Project ID: {}
5862
\r Open Source: {}
5963
\r Downloads: {}
6064
\r Authors: {}
6165
\r Categories: {}
6266
\r License: {}{}
6367
",
64-
project.title.bold().italic(),
65-
project.description,
68+
project.title.bold(),
69+
project.description.italic(),
6670
format!("https://modrinth.com/mod/{}", project.slug)
6771
.blue()
6872
.underline(),
73+
"Modrinth Mod".dimmed(),
74+
project.id.dimmed(),
6975
project.source_url.map_or("No".red(), |url| {
7076
format!("Yes ({})", url.blue().underline()).green()
7177
}),
@@ -104,17 +110,21 @@ pub async fn github(github: Arc<Octocrab>, full_name: (String, String)) -> Resul
104110
println!(
105111
"{}{}\n
106112
\r Link: {}
107-
\r Source: GitHub Repository
113+
\r Source: {}
114+
\r Identifier: {}
108115
\r Open Source: {}
109116
\r Downloads: {}
110117
\r Authors: {}
111118
\r Topics: {}
112119
\r License: {}
113120
",
114-
repo.name.bold().italic(),
121+
repo.name.bold(),
115122
repo.description
116-
.map_or("".into(), |description| { format!("\n {}", description) }),
123+
.map_or("".into(), |description| { format!("\n {}", description) })
124+
.italic(),
117125
repo.html_url.unwrap().to_string().blue().underline(),
126+
"GitHub Repository".dimmed(),
127+
repo.full_name.unwrap().dimmed(),
118128
"Yes".green(),
119129
downloads.to_string().yellow(),
120130
repo.owner.unwrap().login.cyan(),

src/subcommands/upgrade.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ use std::{
1515
Arc, Mutex,
1616
},
1717
};
18-
use tokio::{fs::copy, spawn};
18+
use tokio::{
19+
fs::{copy, remove_file},
20+
spawn,
21+
};
1922

2023
pub async fn upgrade(
2124
modrinth: Arc<Ferinth>,
@@ -118,12 +121,14 @@ pub async fn upgrade(
118121
to_install.iter().find_position(|thing| filename == thing.0)
119122
{
120123
to_install.swap_remove(index);
121-
} else {
122-
let _ = move_file(
123-
file.path(),
124-
profile.output_dir.join(".old").join(filename),
125-
&CopyOptions::new(),
126-
);
124+
} else if move_file(
125+
file.path(),
126+
profile.output_dir.join(".old").join(filename),
127+
&CopyOptions::new(),
128+
)
129+
.is_err()
130+
{
131+
remove_file(file.path()).await?;
127132
}
128133
}
129134
}

0 commit comments

Comments
 (0)