api: fix bottle_tag identification

This commit is contained in:
Nanda H Krishna 2023-03-02 23:29:09 -05:00
parent 3113b44d1f
commit bb4f41ea43
No known key found for this signature in database
GPG Key ID: 067E5FCD58ADF3AA

View File

@ -159,8 +159,10 @@ module Homebrew
sig { params(json: Hash).returns(Hash) } sig { params(json: Hash).returns(Hash) }
def self.merge_variations(json) def self.merge_variations(json)
if (bottle_tag = ::Utils::Bottles.tag.to_s.presence) && bottle_tag = ::Utils::Bottles::Tag.new(system: Homebrew::SimulateSystem.current_os,
(variations = json["variations"].presence) && arch: Homebrew::SimulateSystem.current_arch)
if (variations = json["variations"].presence) &&
(variation = variations[bottle_tag].presence) (variation = variations[bottle_tag].presence)
json = json.merge(variation) json = json.merge(variation)
end end