macOS fixes, trying to fix homebrew icon
This commit is contained in:
parent
edcfe68bf4
commit
ad4b4b1c1b
7 changed files with 208 additions and 94 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue