sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit b15e43d8bb5d6637d878bf7625d585cbce47b978
parent 8b55c56e84b91739676c8012b13cda2c67db6dea
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Sat, 15 Nov 2008 16:37:22 -0800

Merge commit 'c45207/shutdown-hook' into next

Diffstat:
M bin/sup | 10 ++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/bin/sup b/bin/sup
@@ -45,6 +45,14 @@ No variables.
 No return value.
 EOS
 
+Redwood::HookManager.register "shutdown", <<EOS 
+Executes when sup is shutting down. May be run when sup is crashing,
+so don\'t do anything too important. Run before the label, contacts,
+and people are saved.
+No variables.
+No return value.
+EOS
+
 if $opts[:list_hooks]
   Redwood::HookManager.print_hooks
   exit
@@ -276,6 +284,8 @@ ensure
     Index.stop_lock_update_thread
   end
 
+  HookManager.run "shutdown"
+
   Redwood::finish
   stop_cursing
   Redwood::log "stopped cursing"