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 {
326
326
pub fn handle ( self ) -> CrateResult {
327
327
use std:: env:: consts;
328
328
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!
329
333
if !self . bypass_root_check {
330
334
escalate_root ( ) ;
331
335
}
332
336
333
- let artifact = find_ext ( self . manifest . as_ref ( ) ) ?;
334
-
335
337
let ( mut ext_path, mut php_ini) = if let Some ( install_dir) = self . install_dir {
336
338
( install_dir, None )
337
339
} else {
@@ -587,8 +589,7 @@ fn escalate_root() {
587
589
// use sudo and pass PATH for command like `cargo metadata` to keep working.
588
590
#[ cfg( unix) ]
589
591
{
590
- println ! ( "Using sudo..." ) ;
591
592
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." ) ;
593
594
}
594
595
}
You can’t perform that action at this time.
0 commit comments