ignore lower case directories
This commit is contained in:
parent
8b3adbb01e
commit
3fbe4c8f62
@ -28,6 +28,8 @@ import System.Directory
|
|||||||
import System.FilePath (replaceExtension, (</>))
|
import System.FilePath (replaceExtension, (</>))
|
||||||
import System.PosixCompat.Files (getFileStatus, setFileTimes,
|
import System.PosixCompat.Files (getFileStatus, setFileTimes,
|
||||||
accessTime, modificationTime)
|
accessTime, modificationTime)
|
||||||
|
import Data.Char (isUpper)
|
||||||
|
|
||||||
|
|
||||||
touch :: IO ()
|
touch :: IO ()
|
||||||
touch = touchDeps id updateFileTime =<< fmap snd (getDeps [])
|
touch = touchDeps id updateFileTime =<< fmap snd (getDeps [])
|
||||||
@ -107,16 +109,20 @@ findHaskellFiles path = do
|
|||||||
fmap concat $ mapM go contents
|
fmap concat $ mapM go contents
|
||||||
where
|
where
|
||||||
go ('.':_) = return []
|
go ('.':_) = return []
|
||||||
go ('c':"abal-dev") = return []
|
go filename = do
|
||||||
go ('d':"ist") = return []
|
d <- doesDirectoryExist full
|
||||||
go x = do
|
if not d
|
||||||
let y = path </> x
|
then return []
|
||||||
d <- doesDirectoryExist y
|
else if isHaskellDir
|
||||||
if d
|
then findHaskellFiles full
|
||||||
then findHaskellFiles y
|
else if isHaskellFile
|
||||||
else if ".hs" `isSuffixOf` x || ".lhs" `isSuffixOf` x
|
then return [full]
|
||||||
then return [y]
|
else return []
|
||||||
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
|
data TempType = Verbatim | Messages FilePath | StaticFiles FilePath
|
||||||
#if __GLASGOW_HASKELL__ < 704
|
#if __GLASGOW_HASKELL__ < 704
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user