Please sign in to comment.
Unify executable lookup (which_*) into one
In the case of Windows, shelling out to perform the lookup was even more expensive than POSIX. What was done here is remove the dependency on `which.bat` support file and perform a direct lookup over ENV['PATH'] looking for the required executable. The approach taken will append '.exe' to supplied cmd name under Windows. Only .exe are truly executables and anything else (.bat, .vbs, .msc) can't be executed directly. To execute batch files (.bat, .cmd), Ruby wraps them with cmd.exe. Based on existing executables on the platform (node.exe, cscript.exe) and that .com hasn't been seen in the past 10 years (only for compatibility), the lookup over PATHEXT seems unnecessary.
- Loading branch information...