Merge pull request #17304 from Homebrew/bundler_cache

utils/gems: use HOMEBREW_CACHE for bundler cache.
This commit is contained in:
Carlo Cabrera 2024-05-15 22:41:04 +08:00 committed by GitHub
commit 56db99ee9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -224,6 +224,7 @@ module Homebrew
old_path = ENV.fetch("PATH", nil) old_path = ENV.fetch("PATH", nil)
old_gem_path = ENV.fetch("GEM_PATH", nil) old_gem_path = ENV.fetch("GEM_PATH", nil)
old_gem_home = ENV.fetch("GEM_HOME", nil) old_gem_home = ENV.fetch("GEM_HOME", nil)
old_bundle_cache_path = ENV.fetch("BUNDLE_CACHE_PATH", nil)
old_bundle_gemfile = ENV.fetch("BUNDLE_GEMFILE", nil) old_bundle_gemfile = ENV.fetch("BUNDLE_GEMFILE", nil)
old_bundle_with = ENV.fetch("BUNDLE_WITH", nil) old_bundle_with = ENV.fetch("BUNDLE_WITH", nil)
old_bundle_frozen = ENV.fetch("BUNDLE_FROZEN", nil) old_bundle_frozen = ENV.fetch("BUNDLE_FROZEN", nil)
@ -243,6 +244,7 @@ module Homebrew
groups |= (user_gem_groups & valid_gem_groups) groups |= (user_gem_groups & valid_gem_groups)
groups.sort! groups.sort!
ENV["BUNDLE_CACHE_PATH"] = (HOMEBREW_CACHE/"bundler_cache").to_s
ENV["BUNDLE_GEMFILE"] = gemfile ENV["BUNDLE_GEMFILE"] = gemfile
ENV["BUNDLE_WITH"] = groups.join(" ") ENV["BUNDLE_WITH"] = groups.join(" ")
ENV["BUNDLE_FROZEN"] = "true" ENV["BUNDLE_FROZEN"] = "true"
@ -339,6 +341,7 @@ module Homebrew
ENV["BUNDLE_GEMFILE"] = old_bundle_gemfile ENV["BUNDLE_GEMFILE"] = old_bundle_gemfile
ENV["BUNDLE_WITH"] = old_bundle_with ENV["BUNDLE_WITH"] = old_bundle_with
ENV["BUNDLE_FROZEN"] = old_bundle_frozen ENV["BUNDLE_FROZEN"] = old_bundle_frozen
ENV["BUNDLE_CACHE_PATH"] = old_bundle_cache_path
end end
end end
end end