diff options
author | fxqnlr <[email protected]> | 2023-05-25 22:48:54 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-05-25 22:48:54 +0200 |
commit | d8554e30029bf43dccce72e982784cd01857b0c4 (patch) | |
tree | 72b4ee26a4f980deb1165e615e47598be017e5fa /src/lib.rs | |
parent | 7f1a262999d7a8b7f12a97daf4b6722638dc62a1 (diff) | |
download | modlist-d8554e30029bf43dccce72e982784cd01857b0c4.tar modlist-d8554e30029bf43dccce72e982784cd01857b0c4.tar.gz modlist-d8554e30029bf43dccce72e982784cd01857b0c4.zip |
added mod add progress
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -15,9 +15,10 @@ use error::{ErrorType, MLError, MLE}; | |||
15 | use indicatif::{ProgressStyle, ProgressBar}; | 15 | use indicatif::{ProgressStyle, ProgressBar}; |
16 | use serde::{Deserialize, Serialize}; | 16 | use serde::{Deserialize, Serialize}; |
17 | 17 | ||
18 | pub static STYLE_BAR_POS: &str = "{spinner:.green}{wide_msg}{pos}/{len} [{bar:.green/lime}]"; | ||
19 | pub static STYLE_BAR_BYTE: &str = "{spinner:.green}{wide_msg}{bytes}/{total_bytes} [{bar:.green/lime}]"; | 18 | pub static STYLE_BAR_BYTE: &str = "{spinner:.green}{wide_msg}{bytes}/{total_bytes} [{bar:.green/lime}]"; |
19 | pub static STYLE_BAR_POS: &str = " {wide_msg}{pos}/{len} [{bar:.green/lime}]"; | ||
20 | pub static STYLE_SPINNER: &str = "{spinner:.green}{wide_msg}"; | 20 | pub static STYLE_SPINNER: &str = "{spinner:.green}{wide_msg}"; |
21 | pub static STYLE_OPERATION: &str = " {wide_msg}"; | ||
21 | pub static STYLE_MESSAGE: &str = "{wide_msg}"; | 22 | pub static STYLE_MESSAGE: &str = "{wide_msg}"; |
22 | pub static PROGRESS_CHARS: &str = "#>-"; | 23 | pub static PROGRESS_CHARS: &str = "#>-"; |
23 | 24 | ||
@@ -70,7 +71,7 @@ pub async fn check_game_versions(path: &str, force: bool) -> MLE<()> { | |||
70 | 71 | ||
71 | let creation_time = fs::metadata(path)?.created()?; | 72 | let creation_time = fs::metadata(path)?.created()?; |
72 | if !force && creation_time.elapsed().unwrap() < Duration::from_secs(60 * 60 * 24) { return Ok(()); } | 73 | if !force && creation_time.elapsed().unwrap() < Duration::from_secs(60 * 60 * 24) { return Ok(()); } |
73 | std::io::stdout().flush()?; | 74 | |
74 | let versions = get_game_versions().await; | 75 | let versions = get_game_versions().await; |
75 | remove_file(path)?; | 76 | remove_file(path)?; |
76 | let mut file = File::create(path)?; | 77 | let mut file = File::create(path)?; |