From 11d74d7f84b7683501cbd0e88b62c98016c3a66d Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Tue, 4 Aug 2015 17:00:52 +0200 Subject: Fix bug with modules not being found in global search mode. --- html-test/run.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'html-test') 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 -- cgit v1.2.3