-
Notifications
You must be signed in to change notification settings - Fork 21
/
func@1.15.rb
43 lines (38 loc) · 1.48 KB
/
func@1.15.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.
# func_version:1.15.1
require "fileutils"
class FuncAT115 < Formula
homepage "https://github.com/knative/func"
v = "knative-v1.15.1"
version v
if OS.mac? && Hardware::CPU.intel?
url "https://github.com/knative/func/releases/download/#{v}/func_darwin_amd64"
sha256 "c7f48263c9ec083edd60d2e63c924230576d99126f8ed4f674e707bf4e8054b1"
elsif OS.mac? && Hardware::CPU.arm?
url "https://github.com/knative/func/releases/download/#{v}/func_darwin_arm64"
sha256 "e3805e39470b33c649a11f85b756a166badc134cc88bd7870882732c06cbd1d6"
elsif OS.linux? && Hardware::CPU.arm?
url "https://github.com/knative/func/releases/download/#{v}/func_linux_arm64"
sha256 "fdcbdc5673532d89e2441e2d3566c077acea776ab011149965b6895c0a7323ee"
else
url "https://github.com/knative/func/releases/download/#{v}/func_linux_amd64"
sha256 "a7821788741358b8dfb565ddaa584298d92c1126c3eb459104263dafe8a3ef3d"
end
def install
if OS.mac? && Hardware::CPU.intel?
FileUtils.mv("func_darwin_amd64", "kn-func")
elsif OS.mac? && Hardware::CPU.arm?
FileUtils.mv("func_darwin_arm64", "kn-func")
elsif OS.linux? && Hardware::CPU.arm?
FileUtils.mv("func_linux_arm64", "kn-func")
else
FileUtils.mv("func_linux_amd64", "kn-func")
end
bin.install "kn-func"
ln_s "kn-func", bin/"func"
end
test do
system "#{bin}/kn-func", "version"
end
end