Merge pull request #17313 from Homebrew/utils_gems_homebrew_cache

utils/gems: handle undefined `HOMEBREW_CACHE`.
This commit is contained in:
Mike McQuaid 2024-05-16 11:21:20 +09:00 committed by GitHub
commit 36baa15a7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -244,7 +244,12 @@ module Homebrew
groups |= (user_gem_groups & valid_gem_groups)
groups.sort!
ENV["BUNDLE_CACHE_PATH"] = (HOMEBREW_CACHE/"bundler_cache").to_s
homebrew_cache = if defined?(HOMEBREW_CACHE)
HOMEBREW_CACHE.to_s
else
ENV.fetch("HOMEBREW_CACHE")
end
ENV["BUNDLE_CACHE_PATH"] = "#{homebrew_cache}/bundler_cache"
ENV["BUNDLE_GEMFILE"] = gemfile
ENV["BUNDLE_WITH"] = groups.join(" ")
ENV["BUNDLE_FROZEN"] = "true"