mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
45 lines
1.3 KiB
Ruby
45 lines
1.3 KiB
Ruby
cask "ngrok" do
|
|
arch arm: "arm64", intel: "amd64"
|
|
|
|
on_arm do
|
|
version "3.4.0,agjU2Wdyz17,a"
|
|
sha256 "9e33bddd21fac92dfdcf442c9feb36b73bccd58729e383ad976223566487d7fb"
|
|
end
|
|
on_intel do
|
|
version "3.4.0,jjj8xKsane,a"
|
|
sha256 "d1873f5dd726354dd325522af968da8851757482efd7770d7030ce4ade310612"
|
|
end
|
|
|
|
url "https://bin.equinox.io/#{version.csv.third}/#{version.csv.second}/ngrok-v#{version.major}-#{version.csv.first}-stable-darwin-#{arch}.zip",
|
|
verified: "bin.equinox.io/"
|
|
name "ngrok"
|
|
desc "Reverse proxy, secure introspectable tunnels to localhost"
|
|
homepage "https://ngrok.com/"
|
|
|
|
livecheck do
|
|
url "https://dl.equinox.io/ngrok/ngrok-v#{version.major}/stable/archive"
|
|
regex(%r{href=.*?/([^/]+)/([^/]+)/ngrok[._-]v#{version.major}[._-]v?(\d+(?:\.\d+)+)[._-]darwin[._-]#{arch}\.zip}i)
|
|
strategy :page_match do |page|
|
|
page.scan(regex).map { |match| "#{match[2]},#{match[1]},#{match[0]}" }
|
|
end
|
|
end
|
|
|
|
binary "ngrok"
|
|
|
|
postflight do
|
|
set_permissions "#{staged_path}/ngrok", "0755"
|
|
end
|
|
|
|
zap trash: [
|
|
"~/.ngrok#{version.major}",
|
|
"~/Library/Application Support/ngrok",
|
|
]
|
|
|
|
caveats <<~EOS
|
|
To install shell completions, add this to your profile:
|
|
if command -v ngrok &>/dev/null; then
|
|
eval "$(ngrok completion)"
|
|
fi
|
|
EOS
|
|
end
|