Skip to content

Commit 9a39508

Browse files
Prep for release, & small change to sort command
Also, 100th commit!
1 parent c19f6be commit 9a39508

File tree

7 files changed

+48
-30
lines changed

7 files changed

+48
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- If it contains stuff, it will ask if you want to create a backup
1919
- So that you don't lose the stuff in there when you upgrade
2020
- Along with the original relative directory check
21+
- Made sort command convert to lowercase when sorting
2122

2223
## `v3.25.1`
2324

Cargo.lock

Lines changed: 5 additions & 5 deletions
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.25.1"
3+
version = "3.26.0"
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"

README.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ Simply specify the mods you use through the CLI and in just one command, you can
1515
- Upgrade all your mods in one command, `ferium upgrade`
1616
- Ferium checks that the version being downloaded is the latest one compatible with the chosen mod loader and Minecraft version
1717
- Create multiple profiles and configure different mod loaders, Minecraft versions, output directories, and mods for each
18+
- Configure overrides for mods that are not specified as compatible, but still work
1819

1920
## Installation
2021

2122
Ferium is a compiled, statically linked program that does not require any external dependencies.
2223
On Linux the regular version requires GTK to be installed, but the `no-gui` version does not need this.
2324

25+
Ferium is coming to more package managers soon!
26+
[Tracking Issue](https://github.com/theRookieCoder/ferium/issues/42)
27+
2428
### AUR
2529

2630
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
@@ -39,6 +43,11 @@ Remember to use an add-on like [cargo-update](https://crates.io/crates/cargo-upd
3943

4044
## Overview / Help Page
4145

46+
> Note! A lot of Ferium's backend is in a seperate project [Libium](https://github.com/theRookieCoder/libium).
47+
> It has things like the config, add, upgrade, file pickers, etc
48+
49+
> The config file is located at `~/.config/ferium/config.json` if you're interested in manually editing it
50+
4251
### First Startup
4352

4453
When you first start up, you will have to create a new profile by running `ferium profile create` and entering the details for your profile.
@@ -63,10 +72,12 @@ When you first start up, you will have to create a new profile by running `feri
6372
- For example [Sodium's repository](https://github.com/CaffeineMC/sodium-fabric) has the id `CaffeineMC` and `sodium-fabric`
6473
- You can find these at the top left part of the repository's page as a big 'owner / name'
6574
- So to add [Sodium](https://github.com/CaffeineMC/sodium-fabric), you should run `ferium add-github CaffeineMC sodium-fabric` (again, case-insensitive)
75+
- Note: The GitHub repository has to release JAR files in their Releases for Ferium to download, or else it will refuse to be added
6676

6777
### Upgrading Mods
6878

69-
## _Warning: Upgrading will empty the output directory before downloading your mods!_
79+
> _Warning: Upgrading will empty the output directory before downloading your mods!_
80+
> If your output directory is not empty when setting it, Ferium will offer to create a backup
7081
7182
Now after adding all your mods, run `ferium upgrade` to download all of them to your output directory.
7283
This defaults to `.minecraft/mods`, where `.minecraft` is the default Minecraft resources directory. You don't need to worry about this if you play with Mojang's launcher (unless you changed the resources directory).
@@ -84,8 +95,10 @@ You can also provide the names of the mods to remove as arguments. Mod names wit
8495

8596
#### Advanced
8697

87-
If some mod is compatible with your profile but Ferium does not download it, [create an issue]((https://github.com/theRookieCoder/ferium/issues/new)) if you think it's a bug. Or else, you can disable the game version or mod loader checks by setting `check_game_version` or `check_mod_loader` to false in the specific mod.
88-
For example, [Just Enough Items](https://www.curseforge.com/minecraft/mc-mods/jei) does not specify the mod loader for older minecraft versions such as `1.12.2`. In this case, you would disable the mod loader check like so
98+
If some mod is compatible with your profile but Ferium does not download it, [create an issue]((https://github.com/theRookieCoder/ferium/issues/new)) if you think it's a bug. Or else, you can disable the game version or mod loader checks by setting `check_game_version` or `check_mod_loader` to false for the specific mod.
99+
100+
For example, [Just Enough Items](https://www.curseforge.com/minecraft/mc-mods/jei) does not specify the mod loader for older minecraft versions such as `1.12.2`. In this case, you would add JEI by running `ferium add-curseforge 238222 --dont-check-mod-loader` so that the mod loader check is disabled.
101+
You can also manually disable the mod loader (and/or game version) check(s) in the config like so
89102
```json
90103
{
91104
"name": "Just Enough Items (JEI)",
@@ -107,38 +120,38 @@ You can create a profile by running `ferium profile create` and configuring the
107120
- Minecraft version
108121
- Mod loader
109122

110-
Ferium will automatically switch to the newly created profile.
123+
You can also provide these settings as flags to the create command.
124+
If you want to copy the mods from another profile, provide the `--import` flag. You can also provide the profile name to the `--import` flag, if you don't a profile picker will be shown.
125+
Finally, Ferium will automatically switch to the newly created profile.
111126

112127
#### Configure
113128

114-
You can configure these same settings afterwards by running `ferium profile configure`
129+
You can configure these same settings afterwards by running `ferium profile configure`.
130+
Again, you can provide these settings as flags to the command.
115131

116132
#### Manage
117133

118-
You can see all the profiles you have by running `ferium
119-
profile list`.
120-
Switch between your profiles using `ferium profile switch`.
134+
You can see all the profiles you have by running `ferium profile list`.
135+
Switch between your profiles using `ferium switch`.
121136

122137
#### Delete
123138

124139
You can delete a profile by running `ferium profile delete` and selecting the profile you want to delete.
125140

126141
## Feature Requests
127142

128-
If you would like to make a feature request, check the [issues](https://github.com/theRookieCoder/ferium/issues?q=is%3Aissue) to see if the feature has already been added/planned. If not, [create a new issue](https://github.com/theRookieCoder/ferium/issues/new).
143+
If you would like to make a feature request, check the [issues](https://github.com/theRookieCoder/ferium/issues?q=is%3Aissue) to see if the feature has already been added or is planned. If not, [create a new issue](https://github.com/theRookieCoder/ferium/issues/new).
129144

130145
## Building from Source or Working with Ferium
131146

132-
> Note; A lot of Ferium's backend is in a seperate project, [Libium](https://github.com/theRookieCoder/libium). You might want to make some edits there for things like the config, add, upgrade, etc
133-
134147
Firstly, you need the Rust toolchain which includes `cargo`, `rustup`, etc. You can install these from [the Rust website](https://www.rust-lang.org/tools/install).
135-
You'll also need the [Just](https://github.com/casey/just#installation) command runner, its basically a better version of `make`.
148+
You'll also need the [Just](https://github.com/casey/just#installation) command runner, its basically a much better version of `make`.
136149

137150
If you want to build Ferium without cloning the repo, set the `CURSEFORGE_API_KEY` environment variable, then run `cargo install ferium`.
138151
If you don't have a CurseForge API key you can set the variable to an empty value, however anything using the CurseForge API will not work.
139152

140153
To build the project and install it to your Cargo binary directory, clone the project and run `just install`. If you want to install it for testing a developement version, run `just` (alias for `just install-dev`).
141154

142-
If you want to obtain executables for a specific OS, you can run `just build-<OS>` and replace `<OS>` with `mac`, `win`, or `linux`. The produced binaries will be zipped and moved to `out/`.
155+
If you want to obtain executables for a specific OS, you can run `just build-<OS>` and replace `<OS>` with `mac`, `win`, or `linux`. The produced binaries will be zipped and moved to `out/`. There is also `just build-linux-nogui`for building binaries that don't need GTK.
143156

144-
You can run clippy linters using `just lint`, and integration tests using `cargo test`.
157+
You can run clippy linters using `just lint`, and integration tests using `cargo test`. Finally you can delete all the build and test artefacts by using `just clean`.

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ async fn actual_main() -> Result<()> {
193193
subcommands::remove(profile, mod_names)?;
194194
},
195195
SubCommands::Switch { profile_name } => subcommands::switch(&mut config, profile_name)?,
196-
SubCommands::Sort => profile.mods.sort_by_cached_key(|mod_| mod_.name.clone()),
196+
SubCommands::Sort => profile
197+
.mods
198+
.sort_by_cached_key(|mod_| mod_.name.to_lowercase()),
197199
SubCommands::Upgrade => {
198200
check_internet().await?;
199201
check_empty_profile(profile)?;

src/subcommands/profile/create.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ pub async fn create(
7373
};
7474

7575
if let Some(from) = import {
76+
if config.profiles.is_empty() {
77+
bail!("There are no profiles configured to import mods from")
78+
}
7679
let selection = match from {
7780
// If the profile name has been provided as an option
7881
Some(profile_name) => {

src/subcommands/profile/mod.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,18 @@ fn check_profile_name(config: &mut config::structs::Config, name: &str) -> Resul
6161

6262
async fn check_output_directory(output_dir: &PathBuf) -> Result<()> {
6363
if output_dir.is_relative() {
64-
bail!("The provided output directory is not absolute, i.e. it is a relative path")
64+
bail!("The provided output directory is not absolute, i.e. it is a relative path");
6565
}
6666
if output_dir.file_name().unwrap() != "mods" {
67-
println!("{}", "Warning! The output directory is not called `mods`. Most mod loaders will load a directory called `mods`.".bright_yellow())
67+
println!("{}", "Warning! The output directory is not called `mods`. Most mod loaders will load a directory called `mods`.".bright_yellow());
6868
}
69-
if output_dir.exists() && read_dir(output_dir).await?.next_entry().await?.is_some() {
70-
if Confirm::with_theme(&*THEME)
69+
if output_dir.exists()
70+
&& read_dir(output_dir).await?.next_entry().await?.is_some()
71+
&& Confirm::with_theme(&*THEME)
7172
.with_prompt("Your output directory is not empty and it will be erased when upgrading. Would like to create a backup of it?")
72-
.interact()?
73-
{
74-
let backup_dir = file_picker::pick_folder(&*HOME, "Where should the backup be made?").await.unwrap();
75-
copy(output_dir, backup_dir, &CopyOptions::new())?;
76-
}
73+
.interact()? {
74+
let backup_dir = file_picker::pick_folder(&*HOME, "Where should the backup be made?").await.unwrap();
75+
copy(output_dir, backup_dir, &CopyOptions::new())?;
7776
}
7877
Ok(())
7978
}

0 commit comments

Comments
 (0)