Skip to content

Commit

Permalink
formulary: respect HOMEBREW_BOTTLE_DOMAIN when installing from API
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Feb 7, 2023
1 parent 8fdf6ac commit b6019c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Library/Homebrew/formulary.rb
Expand Up @@ -169,7 +169,12 @@ def self.load_formula_from_api(name, flags:)

if (bottles_stable = json_formula["bottle"]["stable"]).present?
bottle do
root_url bottles_stable["root_url"]
if Homebrew::EnvConfig.bottle_domain != HOMEBREW_BOTTLE_DEFAULT_DOMAIN \
&& bottles_stable["root_url"] == HOMEBREW_BOTTLE_DEFAULT_DOMAIN
root_url Homebrew::EnvConfig.bottle_domain
else
root_url bottles_stable["root_url"]
end
rebuild bottles_stable["rebuild"]
bottles_stable["files"].each do |tag, bottle_spec|
cellar = Formulary.convert_to_string_or_symbol bottle_spec["cellar"]
Expand Down

0 comments on commit b6019c7

Please sign in to comment.