diff --git a/Cargo.toml b/Cargo.toml index 0a8a54e..32caa24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ colored = "^1.6.1" term-painter = "^0.2.4" chrono = "^0.4.6" dirs = "^2.0.2" +number_prefix = "0.4" [target.'cfg(windows)'.build-dependencies] winres = "^0.1.6" diff --git a/src/main.rs b/src/main.rs index b9a3672..595ccad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -173,7 +173,7 @@ fn fetch_and_extract_new_version( Ok(()) } -fn update_filter() -> Result<(), Box> { +fn update_filter(force: bool) -> Result<(), Box> { // Determine the directory on the filesystem, where PoE filters should live. let local_dir = determine_poe_dir()?; println!( @@ -210,7 +210,7 @@ fn update_filter() -> Result<(), Box> { println!(); // If the tag names are equal, then return. - if current_version == latest_release.tag_name { + if current_version == latest_release.tag_name && !force { println!("Latest version is already installed, doing nothing..."); return Ok(()); } @@ -226,7 +226,9 @@ fn update_filter() -> Result<(), Box> { } fn main() { - if let Err(err) = update_filter() { + let force = std::env::args().any(|e| e == "-f"); + + if let Err(err) = update_filter(force) { println!("Error updating filter: {}", err); process::exit(1); }