Skip to content

Commit a5d0b57

Browse files
committed
upgrade info
1 parent 879ad4c commit a5d0b57

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/commands/upgrade.rs

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
1-
use crate::utils::display::print_unicode_box;
2-
use crate::utils::download::download_binary;
31
use clap::Command;
2+
use std::process;
43
use colored::*;
5-
use std::process::{self};
4+
use crate::utils::display::print_unicode_box;
5+
use crate::utils::download::download_binary;
6+
use crate::utils::stackql::get_version;
67

78
pub fn command() -> Command {
8-
Command::new("upgrade").about("Upgrade the CLI and dependencies")
9+
Command::new("upgrade").about("Upgrade stackql to the latest version")
910
}
1011

1112
pub fn execute() {
1213
print_unicode_box("📦 Upgrading stackql...");
13-
14+
1415
// Download the latest version of stackql binary
1516
match download_binary() {
1617
Ok(path) => {
17-
println!("Successfully upgraded stackql binary to the latest version at:");
18+
// Get the version of the newly installed binary
19+
match get_version() {
20+
Ok(version_info) => {
21+
println!("Successfully upgraded stackql binary to the latest version ({}) at:", version_info.version);
22+
},
23+
Err(_) => {
24+
println!("Successfully upgraded stackql binary to the latest version at:");
25+
}
26+
}
1827
println!("{}", path.display().to_string().green());
1928
println!("Upgrade complete!");
20-
}
29+
},
2130
Err(e) => {
2231
eprintln!("{}", format!("Error upgrading stackql binary: {}", e).red());
2332
process::exit(1);
2433
}
2534
}
26-
}
35+
}

0 commit comments

Comments
 (0)