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)
|
class_s = Formulary.class_s(name)
|
||||||
json_formula = Homebrew::API::Formula.all_formulae[name]
|
json_formula = Homebrew::API::Formula.all_formulae[name]
|
||||||
|
|
||||||
bottle_tag = Utils::Bottles.tag.to_s
|
if (bottle_tag = Utils::Bottles.tag.to_s.presence) &&
|
||||||
if json_formula.key?("variations") && json_formula["variations"].key?(bottle_tag)
|
(variations = json_formula["variations"].presence) &&
|
||||||
json_formula = json_formula.merge(json_formula["variations"][bottle_tag])
|
(variation = variations[bottle_tag].presence)
|
||||||
|
json_formula = json_formula.merge(variation)
|
||||||
end
|
end
|
||||||
|
|
||||||
uses_from_macos_names = json_formula["uses_from_macos"].map do |dep|
|
uses_from_macos_names = json_formula["uses_from_macos"].map do |dep|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user