-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathsource-kafka.rb
43 lines (37 loc) · 1.74 KB
/
source-kafka.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.
# source-kafka_version:1.16.0
require "fileutils"
class SourceKafka < Formula
homepage "https://github.com/knative-extensions/kn-plugin-source-kafka"
v = "knative-v1.16.0"
version v
if OS.mac? && Hardware::CPU.intel?
url "https://github.com/knative-extensions/kn-plugin-source-kafka/releases/download/#{v}/kn-source-kafka-darwin-amd64"
sha256 "d2be0f6a39b7a4ed3bce8f03b6d77e62ed37ee02e8ed8b2c6632f7c55f636e43"
elsif OS.mac? && Hardware::CPU.arm?
url "https://github.com/knative-extensions/kn-plugin-source-kafka/releases/download/#{v}/kn-source-kafka-darwin-arm64"
sha256 "97f88ee23d4f789201565f4a2e960bbfd7ec54542b51ad3bdd5f262c7e8e67d1"
elsif OS.linux? && Hardware::CPU.arm?
url "https://github.com/knative-extensions/kn-plugin-source-kafka/releases/download/#{v}/kn-source-kafka-linux-arm64"
sha256 "2819288f2ad7e118b30a4323e8af8784e94bc5887db3a6e702712471683f0063"
else
url "https://github.com/knative-extensions/kn-plugin-source-kafka/releases/download/#{v}/kn-source-kafka-linux-amd64"
sha256 "90a7c792e3674fc7df0c35ef75afa417b00c07258c988d5fab83eabcce25e5c2"
end
def install
if OS.mac? && Hardware::CPU.intel?
FileUtils.mv("kn-source-kafka-darwin-amd64", "kn-source-kafka")
elsif OS.mac? && Hardware::CPU.arm?
FileUtils.mv("kn-source-kafka-darwin-arm64", "kn-source-kafka")
elsif OS.linux? && Hardware::CPU.arm?
FileUtils.mv("kn-source-kafka-linux-arm64", "kn-source-kafka")
else
FileUtils.mv("kn-source-kafka-linux-amd64", "kn-source-kafka")
end
bin.install "kn-source-kafka"
end
test do
system "#{bin}/kn-source-kafka", "version"
end
end