-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclisso.rb.template
50 lines (46 loc) · 1.8 KB
/
clisso.rb.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# typed: false
# frozen_string_literal: true
class Clisso < Formula
desc "Get temporary credentials for cloud providers from the command-line"
homepage "https://github.com/allcloud-io/clisso"
url "https://github.com/allcloud-io/clisso/archive/%VERSION%.tar.gz"
sha256 "%SOURCE_SHA%"
version "%VERSION%"
if OS.mac? && Hardware::CPU.intel?
url "https://github.com/allcloud-io/clisso/releases/download/%VERSION%/clisso-darwin-amd64.zip"
sha256 "%BUILD_DARWIN_AMD64_SHA%"
end
if OS.mac? && Hardware::CPU.arm?
url "https://github.com/allcloud-io/clisso/releases/download/%VERSION%/clisso-darwin-arm64.zip"
sha256 "%BUILD_DARWIN_ARM64_SHA%"
end
def install
if OS.mac? && Hardware::CPU.intel?
bin.install "clisso-darwin-amd64" => "clisso"
elsif OS.mac? && Hardware::CPU.arm?
bin.install "clisso-darwin-arm64" => "clisso"
else
ENV["GOPATH"] = buildpath
ENV.prepend_create_path "PATH", buildpath/"bin"
dir = buildpath/"src/github.com/allcloud-io/clisso"
dir.install buildpath.children - [buildpath/".brew_home"]
cd dir do
ENV["VERSION"] = version
system "make", "-e", "native"
bin.install "build/clisso" => "clisso"
end
end
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! For Homebrew/homebrew-core
# this will need to be a test that verifies the functionality of the
# software. Run the test with `brew test clisso`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system "#{bin}/program", "do", "something"`.
system "#{bin}/clisso", "version"
end
end