]> git.cworth.org Git - sup/commitdiff
handle any errors during manager initialization
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Fri, 8 Jun 2007 22:44:58 +0000 (22:44 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Fri, 8 Jun 2007 22:44:58 +0000 (22:44 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@439 5c8cc53c-5e98-4d25-b20a-d8db53a31250

bin/sup

diff --git a/bin/sup b/bin/sup
index c7d320737eb60e4efb6cc48c6ee4429d1d68182e..cb2e25dea6a0eb0838d022cd6a7cbb78c70ceae5 100644 (file)
--- a/bin/sup
+++ b/bin/sup
@@ -46,9 +46,11 @@ def start_cursing
   Ncurses.stdscr.keypad 1
   Ncurses.curs_set 0
   Ncurses.start_color
+  $cursing = true
 end
 
 def stop_cursing
+  return unless $cursing
   Ncurses.curs_set 1
   Ncurses.echo
   Ncurses.endwin
@@ -82,22 +84,22 @@ EOS
   end
 end
 
-Redwood::start
-Index.load
+begin
+  Redwood::start
+  Index.load
 
-if(s = Index.source_for DraftManager.source_name)
-  DraftManager.source = s
-else
-  Index.add_source DraftManager.new_source
-end
+  if(s = Index.source_for DraftManager.source_name)
+    DraftManager.source = s
+  else
+    Index.add_source DraftManager.new_source
+  end
 
-if(s = Index.source_for SentManager.source_name)
-  SentManager.source = s
-else
-  Index.add_source SentManager.new_source
-end
+  if(s = Index.source_for SentManager.source_name)
+    SentManager.source = s
+  else
+    Index.add_source SentManager.new_source
+  end
 
-begin
   log "starting curses"
   start_cursing
 
@@ -254,7 +256,7 @@ ensure
   Redwood::finish
   stop_cursing
 
-  if SuicideManager.die?
+  if SuicideManager.instantiated? && SuicideManager.die?
     Redwood::log "I've been asked to commit sepuku. I obey!"
   end