Fix cask font paths: include homebrew-fonts/ archive prefix

Homebrew moves the extracted archive directory into the Caskroom
without stripping the top-level name, so font artifact paths need
the homebrew-fonts/ prefix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Troutman 2026-03-07 21:40:58 -06:00
parent 76743cdc4d
commit c85bbccd26
No known key found for this signature in database
135 changed files with 595 additions and 592 deletions

View file

@ -18,8 +18,8 @@ def test_cask_references_correct_font_path(font_name):
_skip_if_no_cask(font_name)
cask_path = CASKS_DIR / f"{font_name}.rb"
content = cask_path.read_text()
assert f"font_files/{font_name}/" in content, (
f"{font_name}: cask does not reference font_files/{font_name}/"
assert f"homebrew-fonts/font_files/{font_name}/" in content, (
f"{font_name}: cask does not reference homebrew-fonts/font_files/{font_name}/"
)
@ -52,10 +52,12 @@ def test_cask_font_files_exist_on_disk(font_name):
_skip_if_no_cask(font_name)
cask_path = CASKS_DIR / f"{font_name}.rb"
content = cask_path.read_text()
# Extract paths from font "..." lines
# Extract paths from font "..." lines; strip the homebrew-fonts/ archive prefix
paths = re.findall(r'^\s*font\s+"([^"]+)"', content, re.MULTILINE)
for rel_path in paths:
full_path = FONT_FILES_DIR.parent / rel_path
# Cask paths include archive root prefix: homebrew-fonts/font_files/...
local_path = rel_path.replace("homebrew-fonts/", "", 1)
full_path = FONT_FILES_DIR.parent / local_path
assert full_path.is_file(), (
f"{font_name}: font artifact references missing file: {rel_path}"
)