OsPath transition Windows build fixes

This gets it building on Windows again, with 1 test suite failure
(addurl).

Sponsored-by: Kevin Mueller
This commit is contained in:
Joey Hess 2025-02-11 19:23:02 -08:00 committed by Joey Hess
parent 9dc43396b3
commit a149336a59
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
23 changed files with 58 additions and 62 deletions

View file

@ -21,10 +21,6 @@ import Utility.Exception
import Utility.PartialPrelude
#endif
#ifdef mingw32_HOST_OS
import System.FilePath
#endif
shellPath :: FilePath
shellPath = "/bin/sh"
@ -46,13 +42,13 @@ findShellCommand f = do
Just ('#':'!':rest) -> case words rest of
[] -> defcmd
(c:ps) -> do
let ps' = map Param ps ++ [File f]
let ps' = map Param ps ++ [File (fromOsPath f)]
-- If the command is not inSearchPath,
-- take the base of it, and run eg "sh"
-- which in some cases on windows will work
-- despite it not being inSearchPath.
ok <- inSearchPath c
return (if ok then c else takeFileName c, ps')
return (if ok then c else fromOsPath (takeFileName (toOsPath c)), ps')
_ -> defcmd
#endif
where