5a50a7cf13
Based on http://hackage.haskell.org/trac/ghc/ticket/3307 , whether FilePath contains decoded unicode varies by OS. So, add a configure check for it. Also, renamed showFile to filePathToString
29 lines
644 B
Haskell
29 lines
644 B
Haskell
{- git-annex command
|
|
-
|
|
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
|
-
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
-}
|
|
|
|
module Command.Find where
|
|
|
|
import Control.Monad (when)
|
|
import Control.Monad.State (liftIO)
|
|
|
|
import Command
|
|
import Content
|
|
import Messages
|
|
|
|
command :: [Command]
|
|
command = [Command "find" (paramOptional $ paramRepeating paramPath) seek
|
|
"lists available files"]
|
|
|
|
seek :: [CommandSeek]
|
|
seek = [withFilesInGit start]
|
|
|
|
{- Output a list of files. -}
|
|
start :: CommandStartString
|
|
start file = isAnnexed file $ \(key, _) -> do
|
|
exists <- inAnnex key
|
|
when exists $ liftIO $ putStrLn $ filePathToString file
|
|
return Nothing
|