2019-06-10 02:16:00 +00:00
|
|
|
class DroneCli < Formula
|
|
|
|
desc "Drone CLI"
|
|
|
|
homepage "https://drone.io"
|
|
|
|
url "https://github.com/drone/drone-cli.git",
|
2019-10-02 18:37:22 +00:00
|
|
|
:tag => "v1.2.0",
|
|
|
|
:revision => "f9fd3fe42bdfa015f2da700de8d00cecbd8adc1a"
|
2019-06-10 02:16:00 +00:00
|
|
|
|
2019-06-10 02:30:54 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2019-10-03 02:44:13 +00:00
|
|
|
sha256 "cde21f2a1c918e095f138b6cccc9870c2a1a76bee8a9a8e3dbee33ab4c54bfbd" => :catalina
|
|
|
|
sha256 "a059cdbe892dd4a7058636503d690da54ac8fab3eaeff7d1ae32e07229282b1a" => :mojave
|
|
|
|
sha256 "5753b74f0c5ede30868d431cc877f934eb5e10a7bc59ede9da54d2f3b785fa8b" => :high_sierra
|
2019-06-10 02:30:54 +00:00
|
|
|
end
|
|
|
|
|
2019-06-10 02:16:00 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
2019-10-02 18:37:22 +00:00
|
|
|
ENV["GO111MODULE"] = "on"
|
2019-06-10 02:16:00 +00:00
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
|
|
|
|
dir = buildpath/"src/github.com/drone/drone-cli"
|
|
|
|
dir.install buildpath.children
|
|
|
|
|
|
|
|
cd dir do
|
|
|
|
system "go", "build", "-ldflags", "-X main.version=#{version}", "-o", bin/"drone", "drone/main.go"
|
|
|
|
prefix.install_metafiles
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
assert_match version.to_s, shell_output("#{bin}/drone --version")
|
|
|
|
|
|
|
|
assert_match /manage logs/, shell_output("#{bin}/drone log 2>&1")
|
|
|
|
end
|
|
|
|
end
|