-
Notifications
You must be signed in to change notification settings - Fork 21
43 lines (37 loc) · 1.6 KB
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
# Generated through hack/update-codegen.sh. Don't edit manually.
# Next line is used to identify version of the file.
# admin_version:1.15.0
require "fileutils"
class AdminAT115 < Formula
homepage "https://github.com/knative-extensions/kn-plugin-admin"
v = "knative-v1.15.0"
version v
if OS.mac? && Hardware::CPU.intel?
url "https://github.com/knative-extensions/kn-plugin-admin/releases/download/#{v}/kn-admin-darwin-amd64"
sha256 "2e306b8fe8be8e19d7ea886aa20903238b45dc69f3b4fb807c2d2151c84a06d9"
elsif OS.mac? && Hardware::CPU.arm?
url "https://github.com/knative-extensions/kn-plugin-admin/releases/download/#{v}/kn-admin-darwin-arm64"
sha256 "5c9d6a5e492454e458c3b72304a0d08e9fd65093986e9ff9cbea9dfc596d3591"
elsif OS.linux? && Hardware::CPU.arm?
url "https://github.com/knative-extensions/kn-plugin-admin/releases/download/#{v}/kn-admin-linux-arm64"
sha256 "ec66d382193d7e0474142ad924beed0c4519949cad61a50ebf4d8c79d1bc01eb"
else
url "https://github.com/knative-extensions/kn-plugin-admin/releases/download/#{v}/kn-admin-linux-amd64"
sha256 "5e4e45c9ddcb983b0ac3ba0e02e898a40ec3d7556001d7c942f79601fe78e6fe"
end
def install
if OS.mac? && Hardware::CPU.intel?
FileUtils.mv("kn-admin-darwin-amd64", "kn-admin")
elsif OS.mac? && Hardware::CPU.arm?
FileUtils.mv("kn-admin-darwin-arm64", "kn-admin")
elsif OS.linux? && Hardware::CPU.arm?
FileUtils.mv("kn-admin-linux-arm64", "kn-admin")
else
FileUtils.mv("kn-admin-linux-amd64", "kn-admin")
end
bin.install "kn-admin"
end
test do
system "#{bin}/kn-admin", "version"
end
end