@@ -335,7 +335,7 @@ ghcSet mtarget = do
335335getInstalledGHCs :: (MonadReader env m , HasDirs env , MonadIO m ) => m [Either FilePath GHCTargetVersion ]
336336getInstalledGHCs = do
337337 ghcdir <- ghcupGHCBaseDir
338- fs <- liftIO $ hideErrorDef [NoSuchThing ] [] $ listDirectory (fromGHCupPath ghcdir)
338+ fs <- liftIO $ hideErrorDef [NoSuchThing ] [] $ listDirectoryDirs (fromGHCupPath ghcdir)
339339 forM fs $ \ f -> case parseGHCupGHCDir f of
340340 Right r -> pure $ Right r
341341 Left _ -> pure $ Left f
@@ -438,7 +438,7 @@ getInstalledHLSs = do
438438 Nothing -> pure $ Left f
439439
440440 hlsdir <- ghcupHLSBaseDir
441- fs <- liftIO $ hideErrorDef [NoSuchThing ] [] $ listDirectory (fromGHCupPath hlsdir)
441+ fs <- liftIO $ hideErrorDef [NoSuchThing ] [] $ listDirectoryDirs (fromGHCupPath hlsdir)
442442 new <- forM fs $ \ f -> case parseGHCupHLSDir f of
443443 Right r -> pure $ Right r
444444 Left _ -> pure $ Left f
@@ -626,7 +626,7 @@ hlsInternalServerScripts ver mghcVer = do
626626 dir <- ghcupHLSDir ver
627627 let bdir = fromGHCupPath dir </> " bin"
628628 fmap (bdir </> ) . filter (\ f -> maybe True (\ gv -> (" -" <> T. unpack (prettyVer gv)) `isSuffixOf` f) mghcVer)
629- <$> liftIO (listDirectory bdir)
629+ <$> liftIO (listDirectoryFiles bdir)
630630
631631-- | Get all binaries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/bin directory, if any.
632632-- Returns the full path.
@@ -639,7 +639,7 @@ hlsInternalServerBinaries ver mghcVer = do
639639 let regex = makeRegexOpts compExtended execBlank ([s |^haskell-language-server-.*$|] :: ByteString )
640640 (Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> " lib" ), Right regex, Left " bin" ]
641641 fmap (bdir </> ) . filter (\ f -> maybe True (\ gv -> (" -" <> T. unpack (prettyVer gv)) `isSuffixOf` f) mghcVer)
642- <$> liftIO (listDirectory bdir)
642+ <$> liftIO (listDirectoryFiles bdir)
643643
644644-- | Get all libraries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/lib/<ghc-ver>/
645645-- directory, if any.
@@ -652,7 +652,7 @@ hlsInternalServerLibs ver ghcVer = do
652652 dir <- fromGHCupPath <$> ghcupHLSDir ver
653653 let regex = makeRegexOpts compExtended execBlank ([s |^haskell-language-server-.*$|] :: ByteString )
654654 (Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> " lib" ), Right regex, Left (" lib" </> T. unpack (prettyVer ghcVer))]
655- fmap (bdir </> ) <$> liftIO (listDirectory bdir)
655+ fmap (bdir </> ) <$> liftIO (listDirectoryFiles bdir)
656656
657657
658658-- | Get the wrapper binary for an hls version, if any.
@@ -936,7 +936,7 @@ ghcToolFiles ver = do
936936 whenM (fmap not $ ghcInstalled ver)
937937 (throwE (NotInstalled GHC ver))
938938
939- files <- liftIO (listDirectory bindir >>= filterM (doesFileExist . (bindir </> )))
939+ files <- liftIO (listDirectoryFiles bindir >>= filterM (doesFileExist . (bindir </> )))
940940 pure (getUniqueTools . groupToolFiles . fmap (dropSuffix exeExt) $ files)
941941
942942 where
0 commit comments