Skip to content

Commit 05c3289

Browse files
Fix #126
1 parent e0f0924 commit 05c3289

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Clean up imports
77
- Fix [#131](https://github.com/gorilla-devs/ferium/issues/131), clean up `main.rs`'s fetching of the current profile and modpack
88
- Fix [#130](https://github.com/gorilla-devs/ferium/issues/130)
9+
- Fix [#126](https://github.com/gorilla-devs/ferium/issues/126). Removed `sort` subcommand, all profiles' mods are sorted when writing to config
910

1011
## `v4.1.2`
1112
### 08.06.2022

src/cli.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ Optionally, provide a list of names of the mods to remove"
7575
#[clap(help("A case-insensitive list of names of a mods to remove"))]
7676
mod_names: Vec<String>,
7777
},
78-
#[clap(about("Sort all your mods in alphabetical order"))]
79-
Sort,
8078
#[clap(about("Download and install the latest version of the mods specified"))]
8179
Upgrade,
8280
}

src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,6 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
282282
check_empty_profile(profile)?;
283283
subcommands::remove(profile, mod_names)?;
284284
},
285-
SubCommands::Sort => get_active_profile(&mut config)?
286-
.mods
287-
.sort_by_cached_key(|mod_| mod_.name.to_lowercase()),
288285
SubCommands::Upgrade => {
289286
check_internet().await?;
290287
let profile = get_active_profile(&mut config)?;
@@ -293,6 +290,11 @@ async fn actual_main(cli_app: Ferium) -> Result<()> {
293290
},
294291
};
295292

293+
config.profiles.iter_mut().for_each(|profile| {
294+
profile
295+
.mods
296+
.sort_by_cached_key(|mod_| mod_.name.to_lowercase())
297+
});
296298
// Update config file with possibly edited config
297299
config::write_file(&mut config_file, &config).await?;
298300

0 commit comments

Comments
 (0)