From 15c3d74f6d51b26827ba71f8f5e3bd85ee709e69 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Tue, 18 Oct 2011 12:09:25 +0900 Subject: [PATCH] regular file check. --- Cabal.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cabal.hs b/Cabal.hs index 0f562f0..2da1100 100644 --- a/Cabal.hs +++ b/Cabal.hs @@ -2,6 +2,7 @@ module Cabal (initializeGHC) where import Control.Applicative hiding (many) +import Control.Monad import CoreMonad import Data.Attoparsec.Char8 import Data.Attoparsec.Enumerator @@ -78,8 +79,9 @@ getDirs = do cabalDir :: FilePath -> IO (Maybe (FilePath,FilePath)) cabalDir dir = do - cnts <- getDirectoryContents dir - case filter isCabal cnts of + cnts <- (filter isCabal <$> getDirectoryContents dir) + >>= filterM doesFileExist + case cnts of [] -> do let dir' = takeDirectory dir if dir' == dir