homebrew-core/Formula/scw.rb
2017-09-21 08:33:57 +02:00

33 lines
1.4 KiB
Ruby

class Scw < Formula
desc "Manage BareMetal Servers from command-line (as easily as with Docker)"
homepage "https://github.com/scaleway/scaleway-cli"
url "https://github.com/scaleway/scaleway-cli/archive/v1.14.tar.gz"
sha256 "8d1c0cd9db51ceb18c819ce52d277897622a227b02abd8a566dacc3523dcda2c"
head "https://github.com/scaleway/scaleway-cli.git"
bottle do
cellar :any_skip_relocation
sha256 "7bab9dbbedcaf00fad74ee52d3ac7dcdd825d28018a9356a6dfe94392cd06ecf" => :high_sierra
sha256 "c2bc2d7b6576719ebed7cd961795e65bea23fc5375b8232643556e9d12b67377" => :sierra
sha256 "f72df0768951c24d5f8b53d7e92715205ac3aa207c9ef7731bd3979ac2525be1" => :el_capitan
sha256 "460c30f2ea93e5ffe5759ed1e20711f1914e31d3d0e25e741434bdf8de1df904" => :yosemite
end
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
ENV["GOBIN"] = buildpath
(buildpath/"src/github.com/scaleway/scaleway-cli").install Dir["*"]
system "go", "build", "-o", "#{bin}/scw", "-v", "-ldflags", "-X github.com/scaleway/scaleway-cli/pkg/scwversion.GITCOMMIT=homebrew", "github.com/scaleway/scaleway-cli/cmd/scw/"
bash_completion.install "src/github.com/scaleway/scaleway-cli/contrib/completion/bash/scw"
zsh_completion.install "src/github.com/scaleway/scaleway-cli/contrib/completion/zsh/_scw"
end
test do
output = shell_output(bin/"scw version")
assert_match "OS/Arch (client): darwin/amd64", output
end
end