Support font sharding in Homebrew/cask
This commit is contained in:
parent
9bf7734749
commit
836d819c43
@ -817,7 +817,11 @@ module Cask
|
|||||||
def audit_cask_path
|
def audit_cask_path
|
||||||
return unless cask.tap.core_cask_tap?
|
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)
|
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"
|
cask_dir/cask_subdir/"#{token.downcase}.rb"
|
||||||
end
|
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]) }
|
sig { override.returns(T::Array[Pathname]) }
|
||||||
def cask_files
|
def cask_files
|
||||||
return super if Homebrew::EnvConfig.no_install_from_api?
|
return super if Homebrew::EnvConfig.no_install_from_api?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user