mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 01:23:57 +02:00

* Merge RubyGems-3.4.7 and Bundler-2.4.7 * Merge RubyGems-3.4.8 and Bundler-2.4.8 * Skip failing test on MSWin * Merge RubyGems-3.4.9 and Bundler-2.4.9 * Merge RubyGems-3.4.10 and Bundler-2.4.10 --------- Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
30 lines
963 B
Ruby
30 lines
963 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "shared_helpers"
|
|
|
|
if Bundler::SharedHelpers.in_bundle?
|
|
require_relative "../bundler"
|
|
|
|
if STDOUT.tty? || ENV["BUNDLER_FORCE_TTY"]
|
|
begin
|
|
Bundler.ui.silence { Bundler.setup }
|
|
rescue Bundler::BundlerError => e
|
|
Bundler.ui.error e.message
|
|
Bundler.ui.warn e.backtrace.join("\n") if ENV["DEBUG"]
|
|
if e.is_a?(Bundler::GemNotFound)
|
|
suggested_cmd = "bundle install"
|
|
original_gemfile = Bundler.original_env["BUNDLE_GEMFILE"]
|
|
suggested_cmd += " --gemfile #{original_gemfile}" if original_gemfile
|
|
Bundler.ui.warn "Run `#{suggested_cmd}` to install missing gems."
|
|
end
|
|
exit e.status_code
|
|
end
|
|
else
|
|
Bundler.ui.silence { Bundler.setup }
|
|
end
|
|
|
|
# We might be in the middle of shelling out to rubygems
|
|
# (RUBYOPT=-rbundler/setup), so we need to give rubygems the opportunity of
|
|
# not being silent.
|
|
Gem::DefaultUserInteraction.ui = nil
|
|
end
|