Merge pull request #14456 from Rylan12/api-language-support

Support `languages` when installing from the API
This commit is contained in:
Rylan Polster 2023-02-03 05:23:55 -05:00 committed by GitHub
commit af9ba41cb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,8 +217,9 @@ module Cask
json_cask.deep_symbolize_keys!
# Download and use the cask source file if there are any `*flight` blocks
if json_cask[:artifacts].any? { |artifact| FLIGHT_STANZAS.include?(artifact.keys.first) }
# 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) } ||
json_cask[:languages].any?
cask_source = Homebrew::API::Cask.fetch_source(token, git_head: json_cask[:tap_git_head])
return FromContentLoader.new(cask_source).load(config: config)
end