homebrew-cask/Casks/gitfiend.rb

37 lines
950 B
Ruby

cask "gitfiend" do
version "0.30.1"
sha256 "ee81b40c15c62709e750f01ad3e57c7c470c569f121a4b6c38a7a0e2b80ce4bf"
url "https://gitfiend.com/resources/GitFiend-#{version}.dmg"
name "GitFiend"
desc "Git client"
homepage "https://gitfiend.com/"
livecheck do
url "https://gitfiend.com/app-info"
strategy :page_match do |page|
JSON.parse(page)["version"]
end
end
auto_updates true
app "GitFiend.app"
# shim script (https://github.com/Homebrew/homebrew-cask/issues/18809)
shimscript = "#{staged_path}/gitfiend.wrapper.sh"
binary shimscript, target: "gitfiend"
preflight do
File.write shimscript, <<~EOS
#!/bin/sh
exec '#{appdir}/GitFiend.app/Contents/MacOS/GitFiend' "$@"
EOS
end
zap trash: [
"~/Library/Application Support/GitFiend",
"~/Library/Preferences/com.tobysuggate.gitfiend.plist",
"~/Library/Saved Application State/com.tobysuggate.gitfiend.savedState",
]
end