Support languages when installing from the API

This commit is contained in:
Rylan Polster 2023-01-28 01:42:19 -06:00
parent 10845a1122
commit c1fdcbdd0e
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64

View File

@ -212,8 +212,9 @@ module Cask
json_cask.deep_symbolize_keys! json_cask.deep_symbolize_keys!
# Use the cask-source API if there are any `*flight` blocks # Use the cask-source API if there are any `*flight` blocks or the cask has multiple languages
if json_cask[:artifacts].any? { |artifact| FLIGHT_STANZAS.include?(artifact.keys.first) } if json_cask[:artifacts].any? { |artifact| FLIGHT_STANZAS.include?(artifact.keys.first) } ||
json_cask[:languages].any?
cask_source = Homebrew::API::CaskSource.fetch(token) cask_source = Homebrew::API::CaskSource.fetch(token)
return FromContentLoader.new(cask_source).load(config: config) return FromContentLoader.new(cask_source).load(config: config)
end end