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 :: (FilePath -> CommandStart) -> Annex [FilePath] -> Annex [CommandStart]
|
||||||
prepFiltered a = prepFilteredGen a id
|
prepFiltered a fs = do
|
||||||
|
|
||||||
prepFilteredGen :: (b -> CommandStart) -> (b -> FilePath) -> Annex [b] -> Annex [CommandStart]
|
|
||||||
prepFilteredGen a d fs = do
|
|
||||||
matcher <- Limit.getMatcher
|
matcher <- Limit.getMatcher
|
||||||
map (proc matcher) <$> fs
|
map (proc matcher) <$> fs
|
||||||
where
|
where
|
||||||
proc matcher v = do
|
proc matcher f = do
|
||||||
let f = d v
|
|
||||||
ok <- matcher f
|
ok <- matcher f
|
||||||
if ok then a v else return Nothing
|
if ok then a f else return Nothing
|
||||||
|
|
||||||
notSymlink :: FilePath -> IO Bool
|
notSymlink :: FilePath -> IO Bool
|
||||||
notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f
|
notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f
|
||||||
|
|
Loading…
Reference in a new issue