aboutsummaryrefslogtreecommitdiff
path: root/Remote/Hook.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-15 20:39:25 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-15 20:39:25 -0400
commitc0c9991c9f5322aef05f4c97d2c3f3bdc3101e46 (patch)
tree9cdd4f7913659329283e8d909fa7c4f98cc567f0 /Remote/Hook.hs
parentff8b6c1bab519f243b67219cc2b43d037b3fa4e2 (diff)
nukes another 15 lines thanks to ifM
Diffstat (limited to 'Remote/Hook.hs')
-rw-r--r--Remote/Hook.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index b37d5e215..1e5c27b91 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -89,13 +89,13 @@ runHook hooktype hook k f a = maybe (return False) run =<< lookupHook hooktype h
where
run command = do
showOutput -- make way for hook output
- res <- liftIO $ boolSystemEnv
- "sh" [Param "-c", Param command] $ hookEnv k f
- if res
- then a
- else do
+ ifM (liftIO $ boolSystemEnv
+ "sh" [Param "-c", Param command] $ hookEnv k f)
+ ( a
+ , do
warning $ hook ++ " hook exited nonzero!"
- return res
+ return False
+ )
store :: String -> Key -> Annex Bool
store h k = do