File tree 1 file changed +10
-7
lines changed
1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -46,19 +46,22 @@ pub fn run_command_selfupdate(paths: &GlobalPaths) -> Result<()> {
46
46
47
47
let version = download_juliaup_version ( & version_url. to_string ( ) ) ?;
48
48
49
- // TODO: how to deal with automatic background updates?
50
- if version <= get_own_version ( ) . unwrap ( ) && std:: io:: stdin ( ) . is_terminal ( ) {
51
- eprintln ! (
52
- "You are trying to install version: {}-{}, but the currently installed version is newer (or the same)" ,
53
- juliaup_channel, version
54
- ) ;
49
+ if version < get_own_version ( ) . unwrap ( ) {
50
+ // If not in iteractive mode, avoid downgrading automatically
51
+ if !std:: io:: stdin ( ) . is_terminal ( ) {
52
+ return Ok ( ( ) ) ;
53
+ }
55
54
55
+ eprintln ! (
56
+ "You are trying to install version: {}-{}, but the currently installed version is newer" ,
57
+ juliaup_channel, version
58
+ ) ;
56
59
match Confirm :: with_theme ( & SimpleTheme )
57
60
. with_prompt ( "Do you want to continue?" )
58
61
. default ( false )
59
62
. interact ( ) ?
60
63
{
61
- true => { }
64
+ true => { } // continue
62
65
false => return Ok ( ( ) ) ,
63
66
}
64
67
}
You can’t perform that action at this time.
0 commit comments