63 lines
2.9 KiB
Ruby
63 lines
2.9 KiB
Ruby
class Certigo < Formula
|
|
desc "Utility to examine and validate certificates in a variety of formats"
|
|
homepage "https://github.com/square/certigo"
|
|
url "https://github.com/square/certigo/archive/v1.13.0.tar.gz"
|
|
sha256 "06d7663b6c46904a020edcaeaceb6476fd808677a1ee0c11b3aaf1926c84da5b"
|
|
license "Apache-2.0"
|
|
head "https://github.com/square/certigo.git", branch: "master"
|
|
|
|
livecheck do
|
|
url :stable
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_monterey: "8d58d141ec797642a5328639290a50e8af1aab185a38c36be13d4a5e8c7aa0a6"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "cbb97e3b924fe9c0074b14c885682c3eec696ded881a65db17af607bfeb85c97"
|
|
sha256 cellar: :any_skip_relocation, monterey: "b11198a9086c6959be63a5fa0eefa0bc563f013868645a70e7d2a65296949acc"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "00a50c8b17d3484987e4aa679b625be5717eda1acead9f4f1e316dc334b04686"
|
|
sha256 cellar: :any_skip_relocation, catalina: "d2e94552ffeb15738fa23d6e03a86908fe2ff2487cb9dc787706ecaf1558b01f"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "f7ea2e7180a7de46d7fcf6cba8027fb8a86b89abf088102ecdd9182224155619"
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
system "./build"
|
|
bin.install "bin/certigo"
|
|
|
|
# Install bash completion
|
|
output = Utils.safe_popen_read("#{bin}/certigo", "--completion-script-bash")
|
|
(bash_completion/"certigo").write output
|
|
|
|
# Install zsh completion
|
|
output = Utils.safe_popen_read("#{bin}/certigo", "--completion-script-zsh")
|
|
(zsh_completion/"_certigo").write output
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.crt").write <<~EOS
|
|
-----BEGIN CERTIFICATE-----
|
|
MIIDLDCCAh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