homebrew-cask/Casks/unison.rb

38 lines
1.2 KiB
Ruby

cask "unison" do
if MacOS.version <= :yosemite
version "2.48.3"
sha256 "d578196d8b38f35c1e0410a1c86ff4e115a91f7eb211201db7a940a3a3e0f099"
url "https://github.com/bcpierce00/unison/releases/download/#{version}/Unison-OS-X-#{version}.zip",
verified: "github.com/bcpierce00/unison/"
else
version "2.51.4,4.12.0"
sha256 "16edf291a9b697794ebb00860317ed40e91b1db8fbebc72a79d3278de6a8cb5f"
url "https://github.com/bcpierce00/unison/releases/download/v#{version.before_comma}/Unison-v#{version.before_comma}.ocaml-#{version.after_comma}.macos-10.15.app.tar.gz",
verified: "github.com/bcpierce00/unison/"
end
name "Unison"
desc "File synchronizer"
homepage "https://www.cis.upenn.edu/~bcpierce/unison/"
livecheck do
url :url
strategy :github_latest do |page|
page.scan(/href=.*?Unison[._-]v?(\d+(?:\.\d+)+)[._-]ocaml[._-]v?(\d+(?:\.\d+)+)[._-]macos/i).map do |match|
"#{match[0]},#{match[1]}"
end
end
end
conflicts_with formula: "unison"
app "Unison.app"
binary "#{appdir}/Unison.app/Contents/MacOS/cltool", target: "unison"
postflight do
system_command "/usr/bin/defaults", args: ["write", "edu.upenn.cis.Unison", "CheckCltool", "-bool", "false"]
end
end