Skip to content

Commit

Permalink
utils/gems: use HOMEBREW_CACHE for bundler cache.
Browse files Browse the repository at this point in the history
Fixes #17276
  • Loading branch information
MikeMcQuaid committed May 15, 2024
1 parent 4a65df6 commit cb86847
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Library/Homebrew/utils/gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def install_bundler_gems!(only_warn_on_failure: false, setup_path: true, groups:
old_path = ENV.fetch("PATH", nil)
old_gem_path = ENV.fetch("GEM_PATH", 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_with = ENV.fetch("BUNDLE_WITH", nil)
old_bundle_frozen = ENV.fetch("BUNDLE_FROZEN", nil)
Expand All @@ -243,6 +244,7 @@ def install_bundler_gems!(only_warn_on_failure: false, setup_path: true, groups:
groups |= (user_gem_groups & valid_gem_groups)
groups.sort!

ENV["BUNDLE_CACHE_PATH"] = (HOMEBREW_CACHE/"bundler_cache").to_s

Check warning on line 247 in Library/Homebrew/utils/gems.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/utils/gems.rb#L247

Added line #L247 was not covered by tests
ENV["BUNDLE_GEMFILE"] = gemfile
ENV["BUNDLE_WITH"] = groups.join(" ")
ENV["BUNDLE_FROZEN"] = "true"
Expand Down Expand Up @@ -339,6 +341,7 @@ def install_bundler_gems!(only_warn_on_failure: false, setup_path: true, groups:
ENV["BUNDLE_GEMFILE"] = old_bundle_gemfile
ENV["BUNDLE_WITH"] = old_bundle_with
ENV["BUNDLE_FROZEN"] = old_bundle_frozen
ENV["BUNDLE_CACHE_PATH"] = old_bundle_cache_path
end
end
end

0 comments on commit cb86847

Please sign in to comment.