File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,15 +103,21 @@ fn upgrade_self() -> Result<()> {
103103 fs:: write( & tmp, script) ?;
104104 let mut cmd = std:: process:: Command :: new( "powershell" ) ;
105105 cmd. arg( "-ExecutionPolicy" ) . arg( "Bypass" ) . arg( "-File" ) . arg( tmp) ;
106- cmd. status( ) ?;
106+ let status = cmd. status( ) ?;
107+ if !status. success( ) {
108+ anyhow:: bail!( "Failed to upgrade dvm" ) ;
109+ }
107110 } else {
108111 let url = "https://raw.githubusercontent.com/justjavac/dvm/main/install.sh" ;
109112 let script = tinyget:: get( url) . send( ) ?;
110113 let script = script. as_str( ) ?;
111114 let tmp = tempfile:: tempdir( ) ?;
112115 let tmp = tmp. path( ) . join( "install.sh" ) ;
113- fs:: write( tmp, script) ?;
114- std:: process:: Command :: new( "bash" ) . arg( script) . status( ) ?;
116+ fs:: write( & tmp, script) ?;
117+ let status = std:: process:: Command :: new( "bash" ) . arg( & tmp) . status( ) ?;
118+ if !status. success( ) {
119+ anyhow:: bail!( "Failed to upgrade dvm" ) ;
120+ }
115121 }
116122 }
117123
You can’t perform that action at this time.
0 commit comments