simplify
This commit is contained in:
parent
2b28c70f5f
commit
afd33b0236
1 changed files with 3 additions and 7 deletions
10
Seek.hs
10
Seek.hs
|
@ -89,17 +89,13 @@ withNothing _ _ = error "This command takes no parameters."
|
|||
|
||||
|
||||
prepFiltered :: (FilePath -> CommandStart) -> Annex [FilePath] -> Annex [CommandStart]
|
||||
prepFiltered a = prepFilteredGen a id
|
||||
|
||||
prepFilteredGen :: (b -> CommandStart) -> (b -> FilePath) -> Annex [b] -> Annex [CommandStart]
|
||||
prepFilteredGen a d fs = do
|
||||
prepFiltered a fs = do
|
||||
matcher <- Limit.getMatcher
|
||||
map (proc matcher) <$> fs
|
||||
where
|
||||
proc matcher v = do
|
||||
let f = d v
|
||||
proc matcher f = do
|
||||
ok <- matcher f
|
||||
if ok then a v else return Nothing
|
||||
if ok then a f else return Nothing
|
||||
|
||||
notSymlink :: FilePath -> IO Bool
|
||||
notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f
|
||||
|
|
Loading…
Reference in a new issue