add --batch
This commit is contained in:
parent
5a781f4e8f
commit
7d0ece86f6
6 changed files with 51 additions and 13 deletions
|
@ -134,15 +134,20 @@ includeCommandAction a = account =<< tryIO (callCommandAction a)
|
|||
- stages, without catching errors. Useful if one command wants to run
|
||||
- part of another command. -}
|
||||
callCommandAction :: CommandStart -> CommandCleanup
|
||||
callCommandAction = start
|
||||
callCommandAction = fromMaybe True <$$> callCommandAction'
|
||||
|
||||
{- Like callCommandAction, but returns Nothing when the command did not
|
||||
- perform any action. -}
|
||||
callCommandAction' :: CommandStart -> Annex (Maybe Bool)
|
||||
callCommandAction' = start
|
||||
where
|
||||
start = stage $ maybe skip perform
|
||||
perform = stage $ maybe failure cleanup
|
||||
cleanup = stage $ status
|
||||
stage = (=<<)
|
||||
skip = return True
|
||||
failure = showEndFail >> return False
|
||||
status r = showEndResult r >> return r
|
||||
skip = return Nothing
|
||||
failure = showEndFail >> return (Just False)
|
||||
status r = showEndResult r >> return (Just r)
|
||||
|
||||
{- Do concurrent output when that has been requested. -}
|
||||
allowConcurrentOutput :: Annex a -> Annex a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue