aboutsummaryrefslogtreecommitdiff
path: root/CmdLine/Action.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2014-12-30 12:49:34 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2014-12-30 12:49:34 -0400
commit6c8393e16f5f652e53e333281ac382bddccb430c (patch)
tree47c0d6f6914615f14d7141aa14c135081b0520d2 /CmdLine/Action.hs
parent42f7b9fdd11a6b61f35e00e958342fab0949bed7 (diff)
Run shutdown cleanup actions even if there were failures processing the command.
Amoung other fixes, this means that addurl will stage added files even if adding one of the urls fails.
Diffstat (limited to 'CmdLine/Action.hs')
-rw-r--r--CmdLine/Action.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/CmdLine/Action.hs b/CmdLine/Action.hs
index db4f768ac..65cdbec14 100644
--- a/CmdLine/Action.hs
+++ b/CmdLine/Action.hs
@@ -17,13 +17,14 @@ import qualified Annex.Queue
type CommandActionRunner = CommandStart -> CommandCleanup
{- Runs a command, starting with the check stage, and then
- - the seek stage. Finishes by printing the number of commandActions that
- - failed. -}
-performCommandAction :: Command -> CmdParams -> Annex ()
-performCommandAction Command { cmdseek = seek, cmdcheck = c, cmdname = name } params = do
+ - the seek stage. Finishes by running the continutation, and
+ - then showing a count of any failures. -}
+performCommandAction :: Command -> CmdParams -> Annex () -> Annex ()
+performCommandAction Command { cmdseek = seek, cmdcheck = c, cmdname = name } params cont = do
mapM_ runCheck c
Annex.changeState $ \s -> s { Annex.errcounter = 0 }
seek params
+ cont
showerrcount =<< Annex.getState Annex.errcounter
where
showerrcount 0 = noop