-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathergo.rb
44 lines (41 loc) · 1.49 KB
/
ergo.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
34
35
36
37
38
39
40
41
42
43
44
class Ergo < Formula
desc "Devops tools 运维工具Ergo"
homepage "https://github.com/ysicing/ergo"
version "3.5.1"
if OS.mac?
if Hardware::CPU.arm?
url "https://github.com/ysicing/ergo/releases/download/#{version}/ergo_darwin_arm64"
sha256 "3943ed3797c97b70e8f64afd28d0776e4c947cd002b25eb53d4614c38b285f54"
else
url "https://github.com/ysicing/ergo/releases/download/#{version}/ergo_darwin_amd64"
sha256 "a95b9b5a4a49d1707d646d7e0e471d440707d14acf36799ab93c523d8cfd6d1f"
end
elsif OS.linux?
if Hardware::CPU.intel?
url "https://github.com/ysicing/ergo/releases/download/#{version}/ergo_linux_amd64"
sha256 "e5a6fa081a36cf4e8ccd6520c55d725d746a5186ab7b00e9c438e2a1b4cfda48"
end
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://github.com/ysicing/ergo/releases/download/#{version}/ergo_linux_arm64"
sha256 "aa2d0d7495ef0f01d3e3c65580e5405a0e9a5ba23ffcfd153eb661f953b04d1d"
end
end
def install
if OS.mac?
if Hardware::CPU.intel?
bin.install "ergo_darwin_amd64" => "ergo"
else
bin.install "ergo_darwin_arm64" => "ergo"
end
elsif OS.linux?
if Hardware::CPU.intel?
bin.install "ergo_linux_amd64" => "ergo"
else
bin.install "ergo_linux_arm64" => "ergo"
end
end
end
test do
assert_match "ergo vervion v#{version}", shell_output("#{bin}/ergo version")
end
end