remove callCommandAction'
This is prep for making batchCommandAction use commandAction, which will enable concurrency for batch mode. Since commandAction can't return anything, have to handle the case of a CommandStart that chooses to do nothing in a different way.
This commit is contained in:
parent
7b4c7a7ffc
commit
7a4f3ff345
2 changed files with 15 additions and 18 deletions
|
@ -174,17 +174,11 @@ accountCommandAction startmsg cleanup = tryNonAsync cleanup >>= \case
|
|||
- stages, without catching errors and without incrementing error counter.
|
||||
- Useful if one command wants to run part of another command. -}
|
||||
callCommandAction :: CommandStart -> CommandCleanup
|
||||
callCommandAction = fromMaybe True <$$> callCommandAction'
|
||||
|
||||
{- Like callCommandAction, but returns Nothing when the command did not
|
||||
- perform any action. -}
|
||||
callCommandAction' :: CommandStart -> Annex (Maybe Bool)
|
||||
callCommandAction' start =
|
||||
start >>= \case
|
||||
Nothing -> return Nothing
|
||||
Just (startmsg, perform) -> do
|
||||
showStartMessage startmsg
|
||||
Just <$> performCommandAction' startmsg perform
|
||||
callCommandAction start = start >>= \case
|
||||
Just (startmsg, perform) -> do
|
||||
showStartMessage startmsg
|
||||
performCommandAction' startmsg perform
|
||||
Nothing -> return True
|
||||
|
||||
performCommandAction' :: StartMessage -> CommandPerform -> CommandCleanup
|
||||
performCommandAction' startmsg perform =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue