File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 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<()> {
4646
4747 let version = download_juliaup_version ( & version_url. to_string ( ) ) ?;
4848
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+ }
5554
55+ eprintln ! (
56+ "You are trying to install version: {}-{}, but the currently installed version is newer" ,
57+ juliaup_channel, version
58+ ) ;
5659 match Confirm :: with_theme ( & SimpleTheme )
5760 . with_prompt ( "Do you want to continue?" )
5861 . default ( false )
5962 . interact ( ) ?
6063 {
61- true => { }
64+ true => { } // continue
6265 false => return Ok ( ( ) ) ,
6366 }
6467 }
You can’t perform that action at this time.
0 commit comments