File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -326,12 +326,14 @@ impl Remove {
326326 pub fn handle ( self ) -> CrateResult {
327327 use std:: env:: consts;
328328
329+ let artifact = find_ext ( self . manifest . as_ref ( ) ) ?;
330+
331+ // Must be called after cargo_manifest call in find_path. Though we are setting PATHso that
332+ // sudo can find cargo but cargo_manifest doesn't use PATH to locate cargo!
329333 if !self . bypass_root_check {
330334 escalate_root ( ) ;
331335 }
332336
333- let artifact = find_ext ( self . manifest . as_ref ( ) ) ?;
334-
335337 let ( mut ext_path, mut php_ini) = if let Some ( install_dir) = self . install_dir {
336338 ( install_dir, None )
337339 } else {
@@ -587,8 +589,7 @@ fn escalate_root() {
587589 // use sudo and pass PATH for command like `cargo metadata` to keep working.
588590 #[ cfg( unix) ]
589591 {
590- println ! ( "Using sudo..." ) ;
591592 sudo:: with_env ( & [ "CARGO" , "PATH" ] )
592- . expect ( "sudo failed, pass --bypass-root-check to disable." ) ;
593+ . expect ( "sudo failed! Use --bypass-root-check to disable." ) ;
593594 }
594595}
You can’t perform that action at this time.
0 commit comments