homebrew-cask/Casks/lightproxy.rb

25 lines
942 B
Ruby

cask "lightproxy" do
version "1.1.36"
sha256 "9d19c02a6db9c54a45436c0bd43cbaceeab0ba4da787f13cc43b8f9d85a12781"
# github.com/alibaba/lightproxy/ was verified as official when first introduced to the cask
url "https://github.com/alibaba/lightproxy/releases/download/v#{version}/LightProxy-#{version}.dmg"
appcast "https://github.com/alibaba/lightproxy/releases.atom"
name "LightProxy"
homepage "https://alibaba.github.io/lightproxy/"
app "LightProxy.app"
uninstall_postflight do
stdout, * = system_command "/usr/bin/security",
args: ["find-certificate", "-a", "-c", "LigthProxy", "-Z"],
sudo: true
hashes = stdout.lines.grep(/^SHA-256 hash:/) { |l| l.split(":").second.strip }
hashes.each do |h|
system_command "/usr/bin/security",
args: ["delete-certificate", "-Z", h],
sudo: true
end
end
end