File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import Hie.Yaml
26
26
import System.Directory
27
27
import System.FilePath.Posix
28
28
import System.FilePattern.Directory (getDirectoryFiles )
29
+ import Debug.Trace
29
30
30
31
newtype Pkgs = Pkgs [FilePath ]
31
32
deriving (Eq , Ord )
@@ -49,15 +50,16 @@ cabalPkgs p = do
49
50
[] -> fail " no cabal files found"
50
51
h : _ -> pure [p </> h]
51
52
xs -> do
52
- cd <- liftIO $ map (p </> ) <$> getDirectoryFiles p (map (matchDirs . T. unpack) xs)
53
+ cd <- liftIO $ map (p </> ) <$> getDirectoryFiles p (map (matchDirs . traceShowId . T. unpack) xs)
53
54
cf <-
54
55
liftIO $
55
56
mapM (\ p -> if takeExtension p == " .cabal" then pure [p] else cfs p) cd
56
57
pure $ concat cf
57
58
where
58
59
cabalP n = liftIO (try $ T. readFile $ p </> n :: IO (Either IOException T. Text ))
59
60
cfs d = filter ((" .cabal" == ) . takeExtension) <$> listDirectory d
60
- matchDirs p | " /" `isSuffixOf` p = p <> " *.cabal"
61
+ matchDirs " ." = " ./*.cabal"
62
+ matchDirs p | " /" `isSuffixOf` p || p == " ." = p <> " *.cabal"
61
63
matchDirs p | " *" `isSuffixOf` p || takeExtension p == " " = p <> " /*.cabal"
62
64
matchDirs p = p
63
65
You can’t perform that action at this time.
0 commit comments