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 {
14921492 }
14931493 }
14941494
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+
14951503 /// Looks for a path for `tool` in an environment variable or config path, defaulting to `tool`
14961504 /// as a path.
14971505 fn get_tool ( & self , tool : & str , from_config : & Option < ConfigRelativePath > ) -> PathBuf {
14981506 self . maybe_get_tool ( tool, from_config)
1499- . unwrap_or_else ( || PathBuf :: from ( tool) )
1507+ . unwrap_or_else ( || self . default_tool_path ( tool) )
15001508 }
15011509
15021510 pub fn jobserver_from_env ( & self ) -> Option < & jobserver:: Client > {
You can’t perform that action at this time.
0 commit comments