diff --git a/Cargo.lock b/Cargo.lock index fecaaff..14d6fbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1465,7 +1465,7 @@ dependencies = [ [[package]] name = "khost" -version = "0.0.12" +version = "0.0.13" dependencies = [ "addr", "bytes", diff --git a/Cargo.toml b/Cargo.toml index f574c55..e14dda6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "khost" -version = "0.0.12" +version = "0.0.13" edition = "2021" authors = ["Kaspa developers"] license = "MIT OR Apache-2.0" diff --git a/src/khost.rs b/src/khost.rs index f8208f8..a2cceae 100644 --- a/src/khost.rs +++ b/src/khost.rs @@ -18,14 +18,15 @@ pub fn update() -> Result<()> { if is_cargo_install() { if let Ok(latest_version) = version::blocking::latest_crate_version("khost", "khost") { if latest_version.is_greater_than(version()) { - log::warning(format!("New version of khost@{latest_version} detected"))?; + log::warning(format!("New version of kHOST@{latest_version} detected"))?; if confirm("Would you like to update?") .initial_value(true) .interact()? { - log::info(format!("Updating khost to {latest_version}"))?; - cmd!("cargo", "install", format!("khost@{latest_version}")).run()?; - log::success(format!("khost updated to {latest_version}"))?; + step(format!("Updating kHOST to {latest_version}"), || { + cmd!("cargo", "install", format!("khost@{latest_version}")).run() + })?; + log::success(format!("kHOST updated to {latest_version}"))?; log::info("(if khost exits, please restart it)")?; outro("Starting new version...")?; println!(); @@ -39,7 +40,6 @@ pub fn update() -> Result<()> { } pub fn surrender() { - let current_exe = std::env::current_exe().unwrap(); - let _ = duct::cmd!(current_exe).run(); + let _ = duct::cmd!("khost").run(); std::process::exit(0); }