We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2f3604 commit 66f0a5bCopy full SHA for 66f0a5b
src/Hie/Implicit/Cradle.hs
@@ -174,10 +174,12 @@ findFileUpwards p dir = do
174
-- | Sees if any file in the directory matches the predicate
175
findFile :: (FilePath -> Bool) -> FilePath -> IO [FilePath]
176
findFile p dir = do
177
- b <- doesDirectoryExist dir
+ b <- doesDirectoryExist dir
178
if b then getFiles else pure []
179
where
180
- getFiles = filter p <$> getDirectoryContents dir
+ getFiles = do
181
+ files <- filter p <$> getDirectoryContents dir
182
+ filterM doesPredFileExist files
183
doesPredFileExist file = doesFileExist $ dir </> file
184
185
biosWorkDir :: FilePath -> MaybeT IO FilePath
0 commit comments