diff options
Diffstat (limited to 'Seek.hs')
-rw-r--r-- | Seek.hs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -4,7 +4,7 @@ - the values a user passes to a command, and prepare actions operating - on them. - - - Copyright 2010-2011 Joey Hess <joey@kitenet.net> + - Copyright 2010-2012 Joey Hess <joey@kitenet.net> - - Licensed under the GNU GPL version 3 or higher. -} @@ -41,6 +41,14 @@ withFilesNotInGit a params = do g <- gitRepo liftIO $ (\p -> LsFiles.notInRepo force p g) l +withPathContents :: ((FilePath, FilePath) -> CommandStart) -> CommandSeek +withPathContents a params = map a . concat <$> liftIO (mapM get params) + where + get p = ifM (isDirectory <$> getFileStatus p) + ( map (\f -> (f, makeRelative p f)) <$> dirContentsRecursive p + , return [(p, takeFileName p)] + ) + withWords :: ([String] -> CommandStart) -> CommandSeek withWords a params = return [a params] |