Skip to content
Browse files

Cause SIGNINT,PIPE to exit

Instead of dumping a stack trace
  • Loading branch information...
1 parent 4da62b7 commit 3687eedb8a9a269d88917e1ffef654581284ffbf @danielbeardsley danielbeardsley committed Apr 11, 2013
Showing with 6 additions and 0 deletions.
  1. +1 −0 bin/feature
  2. +1 −0 bin/hotfix
  3. +1 −0 lib/helpers.rb
  4. +3 −0 lib/signal_handlers.rb
View
1 bin/feature
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+require_relative '../lib/signal_handlers.rb'
require_relative '../lib/github.rb'
require_relative '../lib/git.rb'
require_relative '../lib/helpers.rb'
View
1 bin/hotfix
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+require_relative '../lib/signal_handlers.rb'
require_relative '../lib/github.rb'
require_relative '../lib/git.rb'
require_relative '../lib/helpers.rb'
View
1 lib/helpers.rb
@@ -163,3 +163,4 @@ def wrap_text(txt, col = 80)
/(.{1,#{col}})(?: +|$)\n?|(.{#{col}})/,
"\\1\\3\n")
end
+
View
3 lib/signal_handlers.rb
@@ -0,0 +1,3 @@
+# On a Ctrl-C or a broken pipe, just exit instead of printing a stack strace
+trap "INT", "EXIT"
+trap "PIPE", "EXIT"

0 comments on commit 3687eed

Please sign in to comment.
Something went wrong with that request. Please try again.