Merge pull request #17265 from krehel/cask-font-fixes
Support font sharding in Homebrew/cask
This commit is contained in:
commit
d194ed1b4f
@ -817,7 +817,11 @@ module Cask
|
||||
def audit_cask_path
|
||||
return unless cask.tap.core_cask_tap?
|
||||
|
||||
expected_path = cask.tap.new_cask_path(cask.token)
|
||||
expected_path = if cask.artifacts.any?(Artifact::Font)
|
||||
cask.tap.new_cask_font_path(cask.token)
|
||||
else
|
||||
cask.tap.new_cask_path(cask.token)
|
||||
end
|
||||
|
||||
return if cask.sourcefile_path.to_s.end_with?(expected_path)
|
||||
|
||||
|
||||
@ -1401,6 +1401,13 @@ class CoreCaskTap < AbstractCoreTap
|
||||
cask_dir/cask_subdir/"#{token.downcase}.rb"
|
||||
end
|
||||
|
||||
sig { params(token: String).returns(Pathname) }
|
||||
def new_cask_font_path(token)
|
||||
font_first_letter = T.must(token.split("font-").second)[0].to_s
|
||||
cask_subdir = "fonts/font-#{font_first_letter}"
|
||||
cask_dir/cask_subdir/"#{token.downcase}.rb"
|
||||
end
|
||||
|
||||
sig { override.returns(T::Array[Pathname]) }
|
||||
def cask_files
|
||||
return super if Homebrew::EnvConfig.no_install_from_api?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user