diff options
author | Andre Arko <andre@arko.net> | 2014-04-06 16:55:00 +0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-04-06 16:55:10 +0700 |
commit | 527e62da9412c9c7039cca7f794539a89f4084d8 (patch) | |
tree | da45c4e7a86e5cc18bff03265d5be98f72070ca1 /bin | |
parent | 6913caed339594be776e665961f5d1e8fad4b765 (diff) | |
download | bundler-527e62da9412c9c7039cca7f794539a89f4084d8.tar.gz |
make bundler as fast as bundle
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bundle | 7 | ||||
-rwxr-xr-x | bin/bundler | 23 |
2 files changed, 21 insertions, 9 deletions
@@ -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 35941a2a..63285e96 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 |