-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathfunc@1.14.rb
43 lines (38 loc) · 1.48 KB
/
func@1.14.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.14.0
require "fileutils"
class FuncAT114 < Formula
homepage "https://github.com/knative/func"
v = "knative-v1.14.0"
version v
if OS.mac? && Hardware::CPU.intel?
url "https://github.com/knative/func/releases/download/#{v}/func_darwin_amd64"
sha256 "bd68e6c409e1c1f7df36ecd34e5045fb7cfb952e32b7233bc19c7db640651aef"
elsif OS.mac? && Hardware::CPU.arm?
url "https://github.com/knative/func/releases/download/#{v}/func_darwin_arm64"
sha256 "5c6afbc75df69518b2a8fc438991c18fd4f0b0bc22e0d0da8fb26cb9495b8da5"
elsif OS.linux? && Hardware::CPU.arm?
url "https://github.com/knative/func/releases/download/#{v}/func_linux_arm64"
sha256 "f3afd2875af9e61d161b3b12f58fb061508c6c3bd2abb6600855dabba28e6424"
else
url "https://github.com/knative/func/releases/download/#{v}/func_linux_amd64"
sha256 "286b7a22ffd196ef113dd08f29859d2b8e2ac1eed06115947824d5a6236b7674"
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