summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-04-06 16:55:00 +0700
committerAndre Arko <andre@arko.net>2014-04-06 16:55:10 +0700
commit527e62da9412c9c7039cca7f794539a89f4084d8 (patch)
treeda45c4e7a86e5cc18bff03265d5be98f72070ca1 /bin
parent6913caed339594be776e665961f5d1e8fad4b765 (diff)
downloadbundler-527e62da9412c9c7039cca7f794539a89f4084d8.tar.gz
make bundler as fast as bundle
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bundle7
-rwxr-xr-xbin/bundler23
2 files changed, 21 insertions, 9 deletions
diff --git a/bin/bundle b/bin/bundle
index 7bfdd3a214..63285e96e2 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -14,7 +14,8 @@ $LOAD_PATH.each do |path|
end
end
-require 'bundler/cli'
-
require 'bundler/friendly_errors'
-Bundler.with_friendly_errors { Bundler::CLI.start(ARGV, :debug => true) }
+Bundler.with_friendly_errors do
+ require 'bundler/cli'
+ Bundler::CLI.start(ARGV, :debug => true)
+end
diff --git a/bin/bundler b/bin/bundler
index 35941a2ae4..63285e96e2 100755
--- a/bin/bundler
+++ b/bin/bundler
@@ -1,10 +1,21 @@
#!/usr/bin/env ruby
-require 'bundler'
-require 'bundler/cli'
+# Exit cleanly from an early interrupt
+Signal.trap("INT") { exit 1 }
-ui = Bundler::UI::Shell.new
-ui.error "It's recommended to use Bundler through 'bundle' binary instead of 'bundler'"
+require 'bundler'
+# Check if an older version of bundler is installed
+$LOAD_PATH.each do |path|
+ if path =~ %r'/bundler-0.(\d+)' && $1.to_i < 9
+ err = "Looks like you have a version of bundler that's older than 0.9.\n"
+ err << "Please remove your old versions.\n"
+ err << "An easy way to do this is by running `gem cleanup bundler`."
+ abort(err)
+ end
+end
-bin = "#{File.dirname(__FILE__)}/bundle #{ARGV.join(" ")}"
-exec bin
+require 'bundler/friendly_errors'
+Bundler.with_friendly_errors do
+ require 'bundler/cli'
+ Bundler::CLI.start(ARGV, :debug => true)
+end