diff options
author | Samuel E. Giddins <segiddins@segiddins.me> | 2015-06-02 18:11:13 -0700 |
---|---|---|
committer | Samuel E. Giddins <segiddins@segiddins.me> | 2015-06-02 20:43:29 -0700 |
commit | 304f1fb0e5a857ae115991d785e81892cb6f7ce2 (patch) | |
tree | a7d5f5ceb0b8b726c05c2508bd0ccca3fa9f0fa7 /lib/bundler | |
parent | b6e038cffdbc862ffa48edca82340760fcd27aba (diff) | |
download | bundler-304f1fb0e5a857ae115991d785e81892cb6f7ce2.tar.gz |
Unset UI when yielding to other programsseg-unset-ui
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/cli/exec.rb | 6 | ||||
-rw-r--r-- | lib/bundler/setup.rb | 2 |
2 files changed, 8 insertions, 0 deletions
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 |