summaryrefslogtreecommitdiff
path: root/exe
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-02-22 10:30:56 +1100
committerSamuel Giddins <segiddins@segiddins.me>2017-02-22 10:30:56 +1100
commit616ebf32816822b70cc865730855928044421285 (patch)
tree3ee6f05e87cf64d101048f4f4dd92ff4d064af26 /exe
parent747fee18e234d3794d7106995e5d86e88de6b127 (diff)
downloadbundler-616ebf32816822b70cc865730855928044421285.tar.gz
Print a backtrace on SIGINT in debug modeseg-sigint-debug-backtrace
Diffstat (limited to 'exe')
-rwxr-xr-xexe/bundle5
1 files changed, 4 insertions, 1 deletions
diff --git a/exe/bundle b/exe/bundle
index ec88ea7552..ab2bde16e2 100755
--- a/exe/bundle
+++ b/exe/bundle
@@ -2,7 +2,10 @@
# frozen_string_literal: true
# Exit cleanly from an early interrupt
-Signal.trap("INT") { exit 1 }
+Signal.trap("INT") do
+ Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
+ exit 1
+end
update = "update".start_with?(ARGV.first || " ") && ARGV.find {|a| a.start_with?("--bundler") }
update &&= update =~ /--bundler(?:=(.+))?/ && $1 || "> 0.a"