macOS fixes, trying to fix homebrew icon

This commit is contained in:
Sampo Kivistö 2026-03-17 18:39:42 +02:00
parent edcfe68bf4
commit ad4b4b1c1b
7 changed files with 208 additions and 94 deletions

View file

@ -144,6 +144,27 @@ class Gitcomet < Formula
end
end
def post_install
return unless OS.mac?
target_app = libexec/"GitComet.app"
return unless target_app.exist?
apps_dir = Pathname.new(File.expand_path("~/Applications"))
apps_dir.mkpath unless apps_dir.exist?
launcher_link = apps_dir/"GitComet.app"
if launcher_link.exist? && !launcher_link.symlink?
opoo "Skipping ~/Applications/GitComet.app link because a non-symlink path already exists."
return
end
launcher_link.unlink if launcher_link.symlink?
launcher_link.make_symlink(target_app)
rescue StandardError => e
opoo "Failed to link GitComet.app into ~/Applications: #{e}"
end
test do
assert_match "Usage", shell_output("#{bin}/gitcomet --help")
end