Simplify checking for variations hash availability
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
edc14c3786
commit
d4e5886571
@ -136,9 +136,10 @@ module Formulary
|
||||
class_s = Formulary.class_s(name)
|
||||
json_formula = Homebrew::API::Formula.all_formulae[name]
|
||||
|
||||
bottle_tag = Utils::Bottles.tag.to_s
|
||||
if json_formula.key?("variations") && json_formula["variations"].key?(bottle_tag)
|
||||
json_formula = json_formula.merge(json_formula["variations"][bottle_tag])
|
||||
if (bottle_tag = Utils::Bottles.tag.to_s.presence) &&
|
||||
(variations = json_formula["variations"].presence) &&
|
||||
(variation = variations[bottle_tag].presence)
|
||||
json_formula = json_formula.merge(variation)
|
||||
end
|
||||
|
||||
uses_from_macos_names = json_formula["uses_from_macos"].map do |dep|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user