-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathevent.rb
43 lines (37 loc) · 1.6 KB
/
event.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.
# event_version:1.16.0
require "fileutils"
class Event < Formula
homepage "https://github.com/knative-extensions/kn-plugin-event"
v = "knative-v1.16.0"
version v
if OS.mac? && Hardware::CPU.intel?
url "https://github.com/knative-extensions/kn-plugin-event/releases/download/#{v}/kn-event-darwin-amd64"
sha256 "17f4b80092a2458648c8fc1caba319e84b19f28c117a20180e0067d70cf78623"
elsif OS.mac? && Hardware::CPU.arm?
url "https://github.com/knative-extensions/kn-plugin-event/releases/download/#{v}/kn-event-darwin-arm64"
sha256 "92a31d118f64b439431cc8029ecfefe8df332e8808cad5c4327696368776d20a"
elsif OS.linux? && Hardware::CPU.arm?
url "https://github.com/knative-extensions/kn-plugin-event/releases/download/#{v}/kn-event-linux-arm64"
sha256 "37e1ee25eb418316860eae4d0a35e5dc04be57ff2bc13827936a3babdde276aa"
else
url "https://github.com/knative-extensions/kn-plugin-event/releases/download/#{v}/kn-event-linux-amd64"
sha256 "39b73b1dd4a569c1fc7a54863ad8abec20c5f4d15b153dff115f6fb8037c3e5a"
end
def install
if OS.mac? && Hardware::CPU.intel?
FileUtils.mv("kn-event-darwin-amd64", "kn-event")
elsif OS.mac? && Hardware::CPU.arm?
FileUtils.mv("kn-event-darwin-arm64", "kn-event")
elsif OS.linux? && Hardware::CPU.arm?
FileUtils.mv("kn-event-linux-arm64", "kn-event")
else
FileUtils.mv("kn-event-linux-amd64", "kn-event")
end
bin.install "kn-event"
end
test do
system "#{bin}/kn-event", "version"
end
end