-
Notifications
You must be signed in to change notification settings - Fork 95
/
lightsailctl.rb
33 lines (26 loc) · 1.03 KB
/
lightsailctl.rb
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
# -*- coding: utf-8 -*-
require_relative '../ConfigProvider/config_provider'
class Lightsailctl < Formula
$config_provider = ConfigProvider.new("lightsailctl")
desc "Amazon Lightsail CLI Extensions"
homepage "https://github.com/aws/lightsailctl"
license "Apache-2.0"
version $config_provider.version
url $config_provider.url
sha256 $config_provider.sha256
head "https://github.com/aws/lightsailctl.git", branch: "main"
depends_on "go" => :build
option "with-goproxy-direct",
"Obtain source code of lightsailctl's dependencies directly\n\t" +
"from the respective version control systems, bypassing\n\t" +
"proxy.golang.org module proxy"
def install
if build.with? "goproxy-direct"
ENV["GOPROXY"] = "direct"
end
system "go", "build", "-trimpath", "-o", bin/$config_provider.bin, "main.go"
end
test do
assert_match "Usage of", shell_output("#{bin}/#{$config_provider.bin} --plugin --help 2>&1")
end
end