Skip to content

Commit e3b52f0

Browse files
Fix #63, and a bunch more little changes
1 parent 3471e79 commit e3b52f0

File tree

11 files changed

+147
-147
lines changed

11 files changed

+147
-147
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
matrix:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
1515
env:
16-
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
1716
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1817
steps:
1918
- uses: actions/checkout@v3
@@ -76,7 +75,6 @@ jobs:
7675
needs: build
7776
env:
7877
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
79-
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
8078
steps:
8179
- uses: actions/checkout@v3
8280
- name: Install Rust

CHANGELOG.md

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

3+
## `v3.28.7`
4+
### 12.05.2022
5+
6+
- Added the minor version to all dependencies because `cargo install` doesn't use the lockfile
7+
- Update to Libium 1.14.1
8+
- The CurseForge API key is now written in source, no more environment variable! This is allowed as explained in the source code
9+
- Added `--dont-add-dependencies` flag to add commands ([#63](https://github.com/theRookieCoder/ferium/issues/63))
10+
- Tweak progress bar style colours
11+
- Changed the way the progress bar status is updated so that the spinner is smooth
12+
- Added coloured formatting to profile listing too
13+
314
## `v3.28.6`
415
### 11.05.2022
516

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ferium"
3-
version = "3.28.6"
3+
version = "3.28.7"
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"
@@ -22,26 +22,26 @@ default = ["gui"]
2222
gui = ["libium/gui"]
2323

2424
[dependencies]
25-
tokio = { version = "1.18", default-features = false, features = ["rt-multi-thread", "macros"] }
26-
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"] }
27-
octocrab = { version = "0.16", default-features = false, features = ["rustls"] }
28-
clap = { version = "3.1", features = ["derive"] }
29-
lazy_static = "1.4"
30-
dialoguer = "0.10"
31-
indicatif = "0.16"
32-
itertools = "0.10"
33-
serde_json = "1.0"
34-
fs_extra = "1.2"
35-
colored = "2.0"
36-
ferinth = "2.2"
37-
libium = "1.14"
38-
anyhow = "1.0"
39-
online = "3.0"
40-
semver = "1.0"
41-
bytes = "1.1"
42-
furse = "1.1"
43-
size = "0.1"
44-
url = "2.2"
25+
tokio = { version = "1.18.2", default-features = false, features = ["rt-multi-thread", "macros"] }
26+
reqwest = { version = "0.11.10", default-features = false, features = ["rustls-tls"] }
27+
octocrab = { version = "0.16.0", default-features = false, features = ["rustls"] }
28+
clap = { version = "3.1.18", features = ["derive"] }
29+
lazy_static = "1.4.0"
30+
serde_json = "1.0.81"
31+
dialoguer = "0.10.1"
32+
indicatif = "0.16.2"
33+
itertools = "0.10.3"
34+
fs_extra = "1.2.0"
35+
anyhow = "1.0.57"
36+
colored = "2.0.0"
37+
ferinth = "2.2.1"
38+
libium = "1.14.1"
39+
online = "3.0.1"
40+
semver = "1.0.9"
41+
bytes = "1.1.0"
42+
furse = "1.1.1"
43+
size = "0.1.2"
44+
url = "2.2.2"
4545

4646
[dev-dependencies]
4747
rand = "0.8"

src/cli.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ pub enum SubCommands {
3333
#[clap(long)]
3434
#[clap(help("Whether the mod loader should be checked for this mod"))]
3535
dont_check_mod_loader: bool,
36+
#[clap(long)]
37+
#[clap(help("Do not add any of the mod's dependencies"))]
38+
dont_add_dependencies: bool,
3639
},
3740
#[clap(about("Add a GitHub repository to the profile"))]
3841
AddGithub {
@@ -55,6 +58,9 @@ pub enum SubCommands {
5558
#[clap(long)]
5659
#[clap(help("Whether the mod loader should be checked for this mod"))]
5760
dont_check_mod_loader: bool,
61+
#[clap(long)]
62+
#[clap(help("Do not add any of the mod's dependencies"))]
63+
dont_add_dependencies: bool,
5864
},
5965
#[clap(about("List all the mods in the profile, and with some their metadata if verbose"))]
6066
List {

src/main.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use libium::config::{self, structs::ModIdentifier};
1414
use octocrab::OctocrabBuilder;
1515
use std::sync::Arc;
1616
use subcommands::{add, upgrade};
17-
use tokio::{fs::create_dir_all, io::AsyncReadExt, runtime, spawn};
17+
use tokio::{fs::create_dir_all, runtime, spawn};
1818

1919
const CROSS: &str = "×";
2020
lazy_static! {
@@ -23,7 +23,7 @@ lazy_static! {
2323
pub static ref THEME: dialoguer::theme::ColorfulTheme =
2424
dialoguer::theme::ColorfulTheme::default();
2525
pub static ref STYLE: ProgressStyle = ProgressStyle::default_bar()
26-
.template("{spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {pos}/{len}")
26+
.template("{spinner} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {pos:.cyan}/{len:.blue}")
2727
.progress_chars("#>-");
2828
}
2929

@@ -53,17 +53,15 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
5353
.build()?,
5454
);
5555
let modrinth = Arc::new(Ferinth::new());
56-
let curseforge = Arc::new(Furse::new(env!(
57-
"CURSEFORGE_API_KEY",
58-
"A CurseForge API key is required to build. If you don't have one, you can bypass this by setting the variable to a blank string, however anything using the CurseForge API will not work."
59-
)));
56+
// Yes this is a personal API key, but I am allowed to write it in source.
57+
// The reason is the API key is used for tracking usage, it's not for authentication.
58+
// So please don't use this outside of Ferium, although telling you not to is all I can do...
59+
let curseforge = Arc::new(Furse::new(
60+
"$2a$10$QbCxI6f4KxEs50QKwE2piu1t6oOA8ayOw27H9N/eaH3Sdp5NTWwvO",
61+
));
6062
let mut config_file =
6163
config::get_file(cli_app.config_file.unwrap_or_else(config::file_path)).await?;
62-
let mut config_file_contents = String::new();
63-
config_file
64-
.read_to_string(&mut config_file_contents)
65-
.await?;
66-
let mut config: config::structs::Config = serde_json::from_str(&config_file_contents)?;
64+
let mut config = config::deserialise(&config::read_file(&mut config_file).await?)?;
6765

6866
// The create command must run before getting the profile so that configs without profiles can have profiles added to them
6967
if let SubCommands::Profile {
@@ -103,7 +101,7 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
103101
// Default to first profile if index is set incorrectly
104102
config.active_profile = 0;
105103
config::write_file(&mut config_file, &config).await?;
106-
bail!("Active profile specified incorrectly. Switched to first profile",)
104+
bail!("Active profile specified incorrectly. Switched to first profile")
107105
};
108106

109107
// Run function(s) based on the sub(sub)command to be executed
@@ -112,6 +110,7 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
112110
project_id,
113111
dont_check_game_version,
114112
dont_check_mod_loader,
113+
dont_add_dependencies,
115114
} => {
116115
check_internet().await?;
117116
add::modrinth(
@@ -120,6 +119,7 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
120119
profile,
121120
Some(!dont_check_game_version),
122121
Some(!dont_check_mod_loader),
122+
!dont_add_dependencies,
123123
)
124124
.await?;
125125
},
@@ -145,6 +145,7 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
145145
project_id,
146146
dont_check_game_version,
147147
dont_check_mod_loader,
148+
dont_add_dependencies,
148149
} => {
149150
check_internet().await?;
150151
add::curseforge(
@@ -153,6 +154,7 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
153154
profile,
154155
Some(!dont_check_game_version),
155156
Some(!dont_check_mod_loader),
157+
!dont_add_dependencies,
156158
)
157159
.await?;
158160
},

0 commit comments

Comments
 (0)