Fix mingw PATH handling wrt #371

This commit is contained in:
2022-06-07 14:37:23 +02:00
parent c7dc77e6bc
commit bcff46d3d4
2 changed files with 4 additions and 3 deletions

View File

@@ -231,8 +231,9 @@ createProcessWithMingwPath :: MonadIO m
createProcessWithMingwPath cp = do
msys2Dir <- liftIO ghcupMsys2Dir
cEnv <- Map.fromList <$> maybe (liftIO getEnvironment) pure (env cp)
let mingWPaths = [msys2Dir </> "usr" </> "bin"
,msys2Dir </> "mingw64" </> "bin"]
let mingWPaths = [msys2Dir </> "mingw64" </> "bin"
,msys2Dir </> "usr" </> "bin"
]
paths = ["PATH", "Path"]
curPaths = (\x -> maybe [] splitSearchPath (Map.lookup x cEnv)) =<< paths
newPath = intercalate [searchPathSeparator] (mingWPaths ++ curPaths)