diff options
-rw-r--r-- | lib/bundler.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/exec.rb | 6 | ||||
-rw-r--r-- | lib/bundler/setup.rb | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index d9da139895..5970e2c1e4 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -97,7 +97,7 @@ module Bundler end def ui=(ui) - Bundler.rubygems.ui = UI::RGProxy.new(ui) + Bundler.rubygems.ui = ui ? UI::RGProxy.new(ui) : nil @ui = ui end diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb index 7713906f26..3508c829f8 100644 --- a/lib/bundler/cli/exec.rb +++ b/lib/bundler/cli/exec.rb @@ -15,27 +15,33 @@ module Bundler end def run + ui = Bundler.ui raise ArgumentError if cmd.nil? # First, try to exec directly to something in PATH SharedHelpers.set_bundle_environment bin_path = Bundler.which(@cmd) if bin_path + Bundler.ui = nil Kernel.exec(bin_path, *args) end # If that didn't work, set up the whole bundle Bundler.definition.validate_ruby! Bundler.load.setup_environment + Bundler.ui = nil Kernel.exec(@cmd, *args) rescue Errno::EACCES + Bundler.ui = ui Bundler.ui.error "bundler: not executable: #{cmd}" exit 126 rescue Errno::ENOENT + Bundler.ui = ui Bundler.ui.error "bundler: command not found: #{cmd}" Bundler.ui.warn "Install missing gem executables with `bundle install`" exit 127 rescue ArgumentError + Bundler.ui = ui Bundler.ui.error "bundler: exec needs a command to run" exit 128 end diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb index 6bf598337e..897a1dee85 100644 --- a/lib/bundler/setup.rb +++ b/lib/bundler/setup.rb @@ -21,4 +21,6 @@ if Bundler::SharedHelpers.in_bundle? # Add bundler to the load path after disabling system gems bundler_lib = File.expand_path("../..", __FILE__) $LOAD_PATH.unshift(bundler_lib) unless $LOAD_PATH.include?(bundler_lib) + + Bundler.ui = nil end |