Skip to content

Commit

Permalink
Revert "Merge pull request #5044 from dependabot/brrygrdn/fix-bundler…
Browse files Browse the repository at this point in the history
…-version-passed-to-cli"

This reverts commit 355c453, reversing
changes made to c55e5f8.
  • Loading branch information
mctofu committed Apr 25, 2022
1 parent 0e83753 commit 5c1f454
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions bundler/lib/dependabot/bundler/native_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def clamp(seconds)
def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {})
# Run helper suprocess with all bundler-related ENV variables removed
bundler_major_version = bundler_version.split(".").first
helpers_path = versioned_helper_path(bundler_major_version)
helpers_path = versioned_helper_path(bundler_version: bundler_major_version)
::Bundler.with_original_env do
command = BundleCommand.
new(options[:timeout_per_operation_seconds]).
Expand All @@ -47,7 +47,7 @@ def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {})
args: args,
env: {
# Bundler will pick the matching installed major version
"BUNDLER_VERSION" => installed_bundler_version(bundler_major_version),
"BUNDLER_VERSION" => bundler_version,
"BUNDLE_GEMFILE" => File.join(helpers_path, "Gemfile"),
# Prevent the GEM_HOME from being set to a folder owned by root
"GEM_HOME" => File.join(helpers_path, ".bundle")
Expand All @@ -61,15 +61,8 @@ def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {})
end
end

def self.versioned_helper_path(bundler_major_version)
File.join(native_helpers_root, "v#{bundler_major_version}")
end

# Maps the major version unto the specific version we have installed
def self.installed_bundler_version(bundler_major_version)
return Helpers::V1 if bundler_major_version == "1"

Helpers::V2
def self.versioned_helper_path(bundler_version:)
File.join(native_helpers_root, "v#{bundler_version}")
end

def self.native_helpers_root
Expand Down

0 comments on commit 5c1f454

Please sign in to comment.