From 550954109f8b4596611350d0f14c64383f34bee9 Mon Sep 17 00:00:00 2001 From: commitay Date: Wed, 4 Jul 2018 17:48:35 +1000 Subject: [PATCH] mkcert 0.9.0 (new formula) Closes #29733. Signed-off-by: ilovezfs --- Formula/mkcert.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Formula/mkcert.rb diff --git a/Formula/mkcert.rb b/Formula/mkcert.rb new file mode 100644 index 0000000000..f4c0a300be --- /dev/null +++ b/Formula/mkcert.rb @@ -0,0 +1,29 @@ +class Mkcert < Formula + desc "Simple tool to make locally trusted development certificates" + homepage "https://github.com/FiloSottile/mkcert" + url "https://github.com/FiloSottile/mkcert/archive/v0.9.0.tar.gz" + sha256 "cae5871f83cb4c43e0475b69cf6325e5f731a8597e1557a4e9f042510f93d45b" + + depends_on "go" => :build + + def install + ENV["GOPATH"] = buildpath + (buildpath/"src/github.com/FiloSottile/mkcert").install buildpath.children + + cd "src/github.com/FiloSottile/mkcert" do + system "go", "build", "-o", bin/"mkcert" + prefix.install_metafiles + end + end + + test do + ENV["CAROOT"] = testpath + system bin/"mkcert", "brew.test" + assert_predicate testpath/"brew.test.pem", :exist? + assert_predicate testpath/"brew.test-key.pem", :exist? + output = (testpath/"brew.test.pem").read + assert_match "-----BEGIN CERTIFICATE-----", output + output = (testpath/"brew.test-key.pem").read + assert_match "-----BEGIN PRIVATE KEY-----", output + end +end