File tree 1 file changed +17
-8
lines changed
1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change 1
- use crate :: utils:: display:: print_unicode_box;
2
- use crate :: utils:: download:: download_binary;
3
1
use clap:: Command ;
2
+ use std:: process;
4
3
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;
6
7
7
8
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 " )
9
10
}
10
11
11
12
pub fn execute ( ) {
12
13
print_unicode_box ( "📦 Upgrading stackql..." ) ;
13
-
14
+
14
15
// Download the latest version of stackql binary
15
16
match download_binary ( ) {
16
17
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
+ }
18
27
println ! ( "{}" , path. display( ) . to_string( ) . green( ) ) ;
19
28
println ! ( "Upgrade complete!" ) ;
20
- }
29
+ } ,
21
30
Err ( e) => {
22
31
eprintln ! ( "{}" , format!( "Error upgrading stackql binary: {}" , e) . red( ) ) ;
23
32
process:: exit ( 1 ) ;
24
33
}
25
34
}
26
- }
35
+ }
You can’t perform that action at this time.
0 commit comments