-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathadmin.rb
43 lines (37 loc) · 1.6 KB
/
admin.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
# Generated through hack/update-codegen.sh. Don't edit manually.
# Next line is used to identify version of the file.
# admin_version:1.16.0
require "fileutils"
class Admin < Formula
homepage "https://github.com/knative-extensions/kn-plugin-admin"
v = "knative-v1.16.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 "0e92b62e452b9d5cb11a7cae81c384599cd3ea7c1853850cec7db67466735489"
elsif OS.mac? && Hardware::CPU.arm?
url "https://github.com/knative-extensions/kn-plugin-admin/releases/download/#{v}/kn-admin-darwin-arm64"
sha256 "d234a317af38f4051ad43fef29638b602017a0cdc597547fd92119dd48795eb6"
elsif OS.linux? && Hardware::CPU.arm?
url "https://github.com/knative-extensions/kn-plugin-admin/releases/download/#{v}/kn-admin-linux-arm64"
sha256 "e496e7faeb81948abe7a5ed1943894ebc3e5873534e739cdd622adb788e14dfe"
else
url "https://github.com/knative-extensions/kn-plugin-admin/releases/download/#{v}/kn-admin-linux-amd64"
sha256 "14316581470962d3f02df297ae11390485cba53aaaccf095a801b2de04fac118"
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