-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7816162
commit 9929937
Showing
10 changed files
with
179 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
[package] | ||
|
||
name = "ferium" | ||
version = "4.6.0" | ||
version = "4.7.0" | ||
repository = "https://github.com/gorilla-devs/ferium" | ||
description = "Fast CLI program for managing Minecraft mods and modpacks from Modrinth, CurseForge, and Github Releases" | ||
authors = [ | ||
## Code | ||
"Ilesh Thiada (theRookieCoder) <[email protected]>", # AUR, Scoop, Homebrew, winget | ||
"atamakahere (atamakahere-git)", | ||
"Tuxinal", | ||
|
||
## Package Management | ||
"KyleUltimateS", # AUR | ||
|
@@ -58,7 +59,7 @@ octocrab = "0.38" | |
fs_extra = "1.3" | ||
ferinth = "2.11" | ||
colored = "2.1" | ||
libium = "1.28" | ||
libium = "1.29" | ||
anyhow = "1.0" | ||
furse = "1.5" | ||
size = "0.4" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use std::collections::HashMap; | ||
|
||
use colored::Colorize as _; | ||
use itertools::Itertools as _; | ||
use libium::add::Error; | ||
|
||
pub fn display_successes_failures(successes: &[String], failures: Vec<(String, Error)>) -> bool { | ||
if !successes.is_empty() { | ||
println!( | ||
"{} {}", | ||
"Successfully added".green(), | ||
successes.iter().map(|s| s.bold()).format(", ") | ||
); | ||
} | ||
|
||
let mut grouped_errors = HashMap::new(); | ||
|
||
for (id, error) in failures { | ||
grouped_errors | ||
.entry(error.to_string()) | ||
.or_insert_with(Vec::new) | ||
.push(id); | ||
} | ||
|
||
let pad_len = grouped_errors | ||
.keys() | ||
.map(String::len) | ||
.max() | ||
.unwrap_or(0) | ||
.clamp(0, 50); | ||
|
||
let mut exit_error = false; | ||
for (err, ids) in grouped_errors { | ||
println!( | ||
"{:pad_len$}: {}", | ||
// Change already added into a warning | ||
if err == libium::add::Error::AlreadyAdded.to_string() { | ||
err.yellow() | ||
} else { | ||
exit_error = true; | ||
err.red() | ||
}, | ||
ids.iter().map(|s| s.italic()).format(", ") | ||
); | ||
} | ||
|
||
exit_error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.