diff options
author | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-08-04 17:00:52 +0200 |
---|---|---|
committer | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-08-22 23:40:26 +0200 |
commit | 11d74d7f84b7683501cbd0e88b62c98016c3a66d (patch) | |
tree | 4b878b938c1dfedc48185bc24d711a085896d8dd /html-test | |
parent | cf8f24440d50de82dff9277bc9376cbdcc75e91b (diff) |
Fix bug with modules not being found in global search mode.
Diffstat (limited to 'html-test')
-rwxr-xr-x | html-test/run.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/html-test/run.hs b/html-test/run.hs index b3ca4786..da414171 100755 --- a/html-test/run.hs +++ b/html-test/run.hs @@ -181,19 +181,25 @@ baseDependencies ghcPath = do processFileArgs :: [String] -> IO [FilePath] -processFileArgs [] = filter isSourceFile <$> getDirectoryContents srcDir +processFileArgs [] = + map toModulePath . filter isSourceFile <$> getDirectoryContents srcDir + where + toModulePath = modulePath . takeBaseName processFileArgs args = pure $ map processFileArg args processFileArg :: String -> FilePath processFileArg arg | isSourceFile arg = arg - | otherwise = srcDir </> arg <.> "hs" + | otherwise = modulePath arg isSourceFile :: FilePath -> Bool isSourceFile path = takeExtension path `elem` [".hs", ".lhs"] +modulePath :: String -> FilePath +modulePath mdl = srcDir </> mdl <.> "hs" + data Flag = FlagHaddockPath FilePath |