doctl 1.21.0

Closes #41906.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Igor Kapkov 2019-07-13 11:06:07 +10:00 committed by FX Coudert
parent 79faf02714
commit 9dbb5068f8

View file

@ -1,8 +1,8 @@
class Doctl < Formula
desc "Command-line tool for DigitalOcean"
homepage "https://github.com/digitalocean/doctl"
url "https://github.com/digitalocean/doctl/archive/v1.20.1.tar.gz"
sha256 "bfd0209ab6a10ace41d17608f546a19e806c92f818be2ed0d4bfe8ab256c8a69"
url "https://github.com/digitalocean/doctl/archive/v1.21.0.tar.gz"
sha256 "5f449c0b66998c5d0a42e70901c2feb13b6bffea844ce2ea3e137325c26df283"
head "https://github.com/digitalocean/doctl.git"
bottle do
@ -15,21 +15,23 @@ class Doctl < Formula
depends_on "go" => :build
def install
ENV["GO111MODULE"] = "on"
ENV["GOPATH"] = buildpath
mkdir_p buildpath/"src/github.com/digitalocean/"
ln_sf buildpath, buildpath/"src/github.com/digitalocean/doctl"
doctl_version = version.to_s.split(/\./)
base_flag = "-X github.com/digitalocean/doctl"
ldflags = %W[
#{base_flag}.Major=#{doctl_version[0]}
#{base_flag}.Minor=#{doctl_version[1]}
#{base_flag}.Patch=#{doctl_version[2]}
#{base_flag}.Label=release
].join(" ")
system "go", "build", "-ldflags", ldflags, "github.com/digitalocean/doctl/cmd/doctl"
bin.install "doctl"
src = buildpath/"src/github.com/digitalocean/doctl"
src.install buildpath.children
src.cd do
base_flag = "-X github.com/digitalocean/doctl"
ldflags = %W[
#{base_flag}.Major=#{doctl_version[0]}
#{base_flag}.Minor=#{doctl_version[1]}
#{base_flag}.Patch=#{doctl_version[2]}
#{base_flag}.Label=release
].join(" ")
system "go", "build", "-ldflags", ldflags, "-o", bin/"doctl", "github.com/digitalocean/doctl/cmd/doctl"
end
(bash_completion/"doctl").write `#{bin}/doctl completion bash`
(zsh_completion/"doctl").write `#{bin}/doctl completion zsh`