File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1492,11 +1492,19 @@ impl Config {
1492
1492
}
1493
1493
}
1494
1494
1495
+ fn default_tool_path ( & self , tool : & str ) -> PathBuf {
1496
+ std:: env:: current_exe ( )
1497
+ . ok ( )
1498
+ . and_then ( |exe| exe. parent ( ) . map ( |exe_dir| exe_dir. join ( tool) ) )
1499
+ . filter ( |tool_path| tool_path. exists ( ) )
1500
+ . unwrap_or_else ( || PathBuf :: from ( tool) )
1501
+ }
1502
+
1495
1503
/// Looks for a path for `tool` in an environment variable or config path, defaulting to `tool`
1496
1504
/// as a path.
1497
1505
fn get_tool ( & self , tool : & str , from_config : & Option < ConfigRelativePath > ) -> PathBuf {
1498
1506
self . maybe_get_tool ( tool, from_config)
1499
- . unwrap_or_else ( || PathBuf :: from ( tool) )
1507
+ . unwrap_or_else ( || self . default_tool_path ( tool) )
1500
1508
}
1501
1509
1502
1510
pub fn jobserver_from_env ( & self ) -> Option < & jobserver:: Client > {
You can’t perform that action at this time.
0 commit comments