regular file check.
This commit is contained in:
parent
182db0e584
commit
15c3d74f6d
6
Cabal.hs
6
Cabal.hs
@ -2,6 +2,7 @@
|
|||||||
module Cabal (initializeGHC) where
|
module Cabal (initializeGHC) where
|
||||||
|
|
||||||
import Control.Applicative hiding (many)
|
import Control.Applicative hiding (many)
|
||||||
|
import Control.Monad
|
||||||
import CoreMonad
|
import CoreMonad
|
||||||
import Data.Attoparsec.Char8
|
import Data.Attoparsec.Char8
|
||||||
import Data.Attoparsec.Enumerator
|
import Data.Attoparsec.Enumerator
|
||||||
@ -78,8 +79,9 @@ getDirs = do
|
|||||||
|
|
||||||
cabalDir :: FilePath -> IO (Maybe (FilePath,FilePath))
|
cabalDir :: FilePath -> IO (Maybe (FilePath,FilePath))
|
||||||
cabalDir dir = do
|
cabalDir dir = do
|
||||||
cnts <- getDirectoryContents dir
|
cnts <- (filter isCabal <$> getDirectoryContents dir)
|
||||||
case filter isCabal cnts of
|
>>= filterM doesFileExist
|
||||||
|
case cnts of
|
||||||
[] -> do
|
[] -> do
|
||||||
let dir' = takeDirectory dir
|
let dir' = takeDirectory dir
|
||||||
if dir' == dir
|
if dir' == dir
|
||||||
|
Loading…
Reference in New Issue
Block a user