summaryrefslogtreecommitdiff
path: root/Annex/Action.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Action.hs')
-rw-r--r--Annex/Action.hs35
1 files changed, 35 insertions, 0 deletions
diff --git a/Annex/Action.hs b/Annex/Action.hs
new file mode 100644
index 000000000..f59c9c2f4
--- /dev/null
+++ b/Annex/Action.hs
@@ -0,0 +1,35 @@
+{- git-annex actions
+ -
+ - Copyright 2010-2015 Joey Hess <id@joeyh.name>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+{-# LANGUAGE CPP #-}
+
+module Annex.Action where
+
+import qualified Data.Map as M
+#ifndef mingw32_HOST_OS
+import System.Posix.Signals
+#endif
+
+import Common.Annex
+import qualified Annex
+import Annex.Content
+
+{- Actions to perform each time ran. -}
+startup :: Annex ()
+startup =
+#ifndef mingw32_HOST_OS
+ liftIO $ void $ installHandler sigINT Default Nothing
+#else
+ return ()
+#endif
+
+{- Cleanup actions. -}
+shutdown :: Bool -> Annex ()
+shutdown nocommit = do
+ saveState nocommit
+ sequence_ =<< M.elems <$> Annex.getState Annex.cleanup
+ liftIO reapZombies -- zombies from long-running git processes