From 3fbe4c8f6256672e5c34df8b8e896a87d1e64a31 Mon Sep 17 00:00:00 2001 From: gregwebs Date: Sun, 1 Apr 2012 07:19:14 -0700 Subject: [PATCH] ignore lower case directories --- yesod/Build.hs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/yesod/Build.hs b/yesod/Build.hs index 2f0db6bf..76071f8f 100644 --- a/yesod/Build.hs +++ b/yesod/Build.hs @@ -28,6 +28,8 @@ import System.Directory import System.FilePath (replaceExtension, ()) import System.PosixCompat.Files (getFileStatus, setFileTimes, accessTime, modificationTime) +import Data.Char (isUpper) + touch :: IO () touch = touchDeps id updateFileTime =<< fmap snd (getDeps []) @@ -107,16 +109,20 @@ findHaskellFiles path = do fmap concat $ mapM go contents where go ('.':_) = return [] - go ('c':"abal-dev") = return [] - go ('d':"ist") = return [] - go x = do - let y = path x - d <- doesDirectoryExist y - if d - then findHaskellFiles y - else if ".hs" `isSuffixOf` x || ".lhs" `isSuffixOf` x - then return [y] - else return [] + go filename = do + d <- doesDirectoryExist full + if not d + then return [] + else if isHaskellDir + then findHaskellFiles full + else if isHaskellFile + then return [full] + else return [] + where + -- this could fail on unicode + isHaskellDir = isUpper (head filename) + isHaskellFile = ".hs" `isSuffixOf` filename || ".lhs" `isSuffixOf` filename + full = path filename data TempType = Verbatim | Messages FilePath | StaticFiles FilePath #if __GLASGOW_HASKELL__ < 704