utils/gems: handle undefined HOMEBREW_CACHE.

Some call paths can result in this not being defined so let's handle
that better.
This commit is contained in:
Mike McQuaid 2024-05-16 11:08:51 +09:00
parent 0a358b8518
commit 03bf6db08c
No known key found for this signature in database

View File

@ -244,7 +244,12 @@ 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 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_GEMFILE"] = gemfile
ENV["BUNDLE_WITH"] = groups.join(" ") ENV["BUNDLE_WITH"] = groups.join(" ")
ENV["BUNDLE_FROZEN"] = "true" ENV["BUNDLE_FROZEN"] = "true"