Open hasufell opened 4 weeks ago
So I think, the way we need is this:
searchPathEnvForExes :: OsString -> IO (Maybe OsPath)
searchPathEnvForExes (OsString binary) =
let binary' = if takeExtension binary == exeExtension then binary else binary <.> exeExtension
in fmap OsString <$> Win32.searchPath Nothing binary' Nothing
ignoring the lpExtension
parameter.
But that would not allow us to search for e.g. foo.bat
or other executable-like formats.
This is because "ghc-9.10.1" is considered to contain a file extension. The documentation on
SearchPathW
states underlpExtension
: