2010-12-30 20:08:22 -04:00
|
|
|
{- git-annex command
|
|
|
|
-
|
|
|
|
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.InAnnex where
|
|
|
|
|
2011-10-05 16:02:51 -04:00
|
|
|
import Common.Annex
|
2010-12-30 20:08:22 -04:00
|
|
|
import Command
|
2011-10-04 00:40:47 -04:00
|
|
|
import Annex.Content
|
2010-12-30 20:08:22 -04:00
|
|
|
|
2011-10-29 15:19:05 -04:00
|
|
|
def :: [Command]
|
|
|
|
def = [command "inannex" (paramRepeating paramKey) seek
|
|
|
|
"checks if keys are present in the annex"]
|
2010-12-30 20:08:22 -04:00
|
|
|
|
|
|
|
seek :: [CommandSeek]
|
|
|
|
seek = [withKeys start]
|
|
|
|
|
2011-09-15 16:50:49 -04:00
|
|
|
start :: Key -> CommandStart
|
2011-03-15 22:42:34 -04:00
|
|
|
start key = do
|
2010-12-30 20:08:22 -04:00
|
|
|
present <- inAnnex key
|
|
|
|
if present
|
2011-05-15 02:02:46 -04:00
|
|
|
then stop
|
2011-07-15 12:47:14 -04:00
|
|
|
else liftIO exitFailure
|