X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=bin%2Fsup;fp=bin%2Fsup;h=bbb6c1711a7d5f580530a95859b4853649bf69c9;hb=da1abd360e25011bdbe23b9194f926f29b8aef44;hp=8a377f78149f5a4b17a56e06036fcae96e2b3fb6;hpb=fc260ddb62efcd26747e41d1c8a098bda3174d42;p=sup diff --git a/bin/sup b/bin/sup index 8a377f7..bbb6c17 100755 --- a/bin/sup +++ b/bin/sup @@ -131,37 +131,14 @@ end module_function :start_cursing, :stop_cursing Index.init -begin - Index.lock -rescue Index::LockError => e - require 'highline' - - h = HighLine.new - h.wrap_at = :auto - h.say Index.fancy_lock_error_message_for(e) - - case h.ask("Should I ask that process to kill itself? ") - when /^\s*y(es)?\s*$/i - h.say "Ok, suggesting seppuku..." - FileUtils.touch Redwood::SUICIDE_FN - sleep SuicideManager::DELAY * 2 - FileUtils.rm_f Redwood::SUICIDE_FN - h.say "Let's try that again." - retry - else - h.say < e @@ -328,13 +304,12 @@ begin bm.draw_screen end - bm.kill_all_buffers if SuicideManager.die? + bm.kill_all_buffers if $die rescue Exception => e Redwood::record_exception e, "main" ensure unless $opts[:no_threads] PollManager.stop if PollManager.instantiated? - SuicideManager.stop if PollManager.instantiated? Index.stop_lock_update_thread end @@ -346,7 +321,7 @@ ensure Redwood::Logger.add_sink $stderr, false debug "stopped cursing" - if SuicideManager.instantiated? && SuicideManager.die? + if $die info "I've been ordered to commit seppuku. I obey!" end