Skip to content

Commit

Permalink
sops: remove gopath and improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chenrui333 committed Nov 29, 2019
1 parent a2a56cf commit 46a9e2e
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions Formula/sops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class Sops < Formula
homepage "https://github.com/mozilla/sops"
url "https://github.com/mozilla/sops/archive/v3.5.0.tar.gz"
sha256 "a9c257dc5ddaab736dce08b8c5b1f00e6ca1e3171909b6d7385689044ebe759b"
revision 1
head "https://github.com/mozilla/sops.git"

bottle do
Expand All @@ -12,22 +13,16 @@ class Sops < Formula
sha256 "c2ce8bb370f5b3888de5696707c69627178aabdc6063ff35cce075c3df502a51" => :high_sierra
end

depends_on "go@1.12" => :build
depends_on "go" => :build

def install
ENV["GOPATH"] = buildpath
ENV["GOBIN"] = bin

dir = buildpath/"src/github.com/mozilla/sops"
dir.install buildpath.children

cd dir do
system "make", "install"
prefix.install_metafiles
end
system "go", "build", "-o", bin/"sops", "go.mozilla.org/sops/v3/cmd/sops"
pkgshare.install "example.yaml"
end

test do
assert_match version.to_s, shell_output("#{bin}/sops --version 2>&1")
assert_match version.to_s, shell_output("#{bin}/sops --version")

assert_match "Recovery failed because no master key was able to decrypt the file.", shell_output("#{bin}/sops #{pkgshare}/example.yaml 2>&1", 128)
end
end

0 comments on commit 46a9e2e

Please sign in to comment.