2010-12-31 00:08:22 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
|
|
|
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.InAnnex where
|
|
|
|
|
|
|
|
import Control.Monad.State (liftIO)
|
|
|
|
import System.Exit
|
|
|
|
|
|
|
|
import Command
|
2011-01-16 20:05:05 +00:00
|
|
|
import Content
|
2010-12-31 00:08:22 +00:00
|
|
|
|
|
|
|
command :: [Command]
|
2011-03-19 22:58:49 +00:00
|
|
|
command = [repoCommand "inannex" (paramRepeating paramKey) seek
|
2010-12-31 00:08:22 +00:00
|
|
|
"checks if keys are present in the annex"]
|
|
|
|
|
|
|
|
seek :: [CommandSeek]
|
|
|
|
seek = [withKeys start]
|
|
|
|
|
2011-03-16 02:42:34 +00:00
|
|
|
start :: CommandStartKey
|
|
|
|
start key = do
|
2010-12-31 00:08:22 +00:00
|
|
|
present <- inAnnex key
|
|
|
|
if present
|
|
|
|
then return Nothing
|
|
|
|
else liftIO $ exitFailure
|