Use symlinks for font installation to ~/Library/Fonts/

Homebrew sandboxes post_install, so cp fails with EPERM.
Symlinks work around this and also ensure brew uninstall
can cleanly remove fonts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Troutman 2026-03-07 21:32:43 -06:00
parent 59d8175d75
commit cb1918c30f
No known key found for this signature in database
134 changed files with 804 additions and 268 deletions

View file

@ -121,10 +121,14 @@ class Font{class_name} < Formula
user_fonts.mkpath
Dir.glob(share/"fonts/truetype/*.ttf").each do |f|
system "cp", "-f", f, user_fonts.to_s
target = user_fonts/File.basename(f)
FileUtils.rm_f(target)
FileUtils.ln_sf(f, target)
end
Dir.glob(share/"fonts/opentype/*.otf").each do |f|
system "cp", "-f", f, user_fonts.to_s
target = user_fonts/File.basename(f)
FileUtils.rm_f(target)
FileUtils.ln_sf(f, target)
end
end