Skip to content

Commit

Permalink
Added confirmation version to mia update
Browse files Browse the repository at this point in the history
  • Loading branch information
Azuyamat committed Nov 20, 2023
1 parent 26e1c6c commit c3021eb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mia"
version = "1.1.0"
version = "1.2.0"
edition = "2021"
authors = ["Azuyamat"]

Expand Down
Binary file added mia.exe
Binary file not shown.
15 changes: 10 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,25 @@ fn main() -> Result<(), Error> {
confy::store("mia", None, config).map_err(Error::Config)?;
},
Zip::Update { version } => {
let version = match version {
let mut ver = match &version {
None => { get_latest_release()? }
Some(version) => { version }
Some(version) => { version.to_string() }
};

println!("Updating Mia to {color_bright_green}{version}{color_reset}");
println!("Updating Mia to {color_bright_green}{ver}{color_reset}");

let start = Instant::now();
let mut file = find_or_create_file("mia.exe")?;
let download_link = get_download_link_for_asset(&version)?;
let download_link = get_download_link_for_asset(&ver)?;
download_asset(&download_link, &mut file)?;
let elapsed = start.elapsed().as_millis();

println!("Mia updated in {color_bright_green}{elapsed}ms{color_reset}");
ver = match &version {
None => { get_latest_release()? }
Some(version) => { version.to_string() }
};

println!("Mia updated in {color_bright_green}{elapsed}ms{color_reset} to {color_bright_green}{ver}{color_reset} (Run terminal as administrator if this didn't work)");
},
Zip::Version => {
let version = env!("CARGO_PKG_VERSION");
Expand Down

0 comments on commit c3021eb

Please sign in to comment.