-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathdirctl.rb
More file actions
63 lines (49 loc) · 2.23 KB
/
dirctl.rb
File metadata and controls
63 lines (49 loc) · 2.23 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class Dirctl < Formula
desc "Command-line interface for AGNTCY directory"
homepage "https://github.com/agntcy/dir"
version "v1.0.0"
license "Apache-2.0"
version_scheme 1
url "https://github.com/agntcy/dir/releases/download/#{version}" # NOTE: It is abused to reduce redundancy
# TODO: Livecheck can be used to brew bump later
on_macos do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "#{url}/dirctl-darwin-arm64"
sha256 "bf8cf0d2955afaa3ff63373d9d6f5271701d63715163884b21a1697dedd56847"
def install
bin.install "dirctl-darwin-arm64" => "dirctl"
system "chmod", "+x", bin/"dirctl"
generate_completions_from_executable(bin/"dirctl", "completion", shells: [:bash, :zsh, :fish])
end
end
if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
url "#{url}/dirctl-darwin-amd64"
sha256 "51a24f7eac9e5e1e5d6c808e44de1f34492e6bed80e8138281ec7c99f8bf3b2d"
def install
bin.install "dirctl-darwin-amd64" => "dirctl"
system "chmod", "+x", bin/"dirctl"
generate_completions_from_executable(bin/"dirctl", "completion", shells: [:bash, :zsh, :fish])
end
end
end
on_linux do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "#{url}/dirctl-linux-arm64"
sha256 "26e58e9c9fcea7099572b518fd621193cde0567415274e7d35ebef7bc4ef4b4f"
def install
bin.install "dirctl-linux-arm64" => "dirctl"
system "chmod", "+x", bin/"dirctl"
generate_completions_from_executable(bin/"dirctl", "completion", shells: [:bash, :zsh, :fish])
end
end
if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
url "#{url}/dirctl-linux-amd64"
sha256 "113aa3404b13412a63133967a44c5e999d7f9942d770e43aa005b1f8f7b02cea"
def install
bin.install "dirctl-linux-amd64" => "dirctl"
system "chmod", "+x", bin/"dirctl"
generate_completions_from_executable(bin/"dirctl", "completion", shells: [:bash, :zsh, :fish])
end
end
end
end