removed another 10 lines via ifM
This commit is contained in:
parent
c0c9991c9f
commit
184a69171d
9 changed files with 95 additions and 106 deletions
|
@ -35,14 +35,11 @@ lookupFile0 :: FilePath -> Annex (Maybe (Key, Backend))
|
|||
lookupFile0 = Upgrade.V1.lookupFile1
|
||||
|
||||
getKeysPresent0 :: FilePath -> Annex [Key]
|
||||
getKeysPresent0 dir = do
|
||||
exists <- liftIO $ doesDirectoryExist dir
|
||||
if not exists
|
||||
then return []
|
||||
else do
|
||||
contents <- liftIO $ getDirectoryContents dir
|
||||
files <- liftIO $ filterM present contents
|
||||
return $ map fileKey0 files
|
||||
getKeysPresent0 dir = ifM (liftIO $ doesDirectoryExist dir)
|
||||
( liftIO $ map fileKey0
|
||||
<$> (filterM present =<< getDirectoryContents dir)
|
||||
, return []
|
||||
)
|
||||
where
|
||||
present d = do
|
||||
result <- tryIO $
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue