-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodegpt.rb
44 lines (37 loc) · 1.44 KB
/
codegpt.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
44
class Codegpt < Formula
desc "A CLI written in Go language that writes git commit messages for you using ChatGPT AI (gpt-3.5-turbo model) and automatically installs a git prepare-commit-msg hook."
homepage "https://github.com/appleboy/CodeGPT"
version "0.15.2"
os = OS.mac? ? "darwin" : "linux"
arch = case Hardware::CPU.arch
when :x86_64 then "amd64"
when :arm64 then "arm64"
else
raise "CodeGPT: Unsupported system architecture #{Hardware::CPU.arch}"
end
@@filename = "CodeGPT-#{version}-#{os}-#{arch}"
@@url = "https://github.com/appleboy/CodeGPT/releases/download/v#{version}/#{@@filename}"
@@url += ".xz"
@@using = nil
depends_on "xz"
@@sha256 = case "#{os}-#{arch}"
when "linux-amd64" then "33c3be7750887d8d071b1c1cf4b0d60c95c06212da31167cadd1e6bb4259e332"
when "linux-arm64" then "69b586ff1f883de6ab74fddf600c4af6601982f64dc6b2031288e599ad7ea27e"
when "darwin-amd64" then "a671b964efa03e6d86a831d033324283a19804baa53e6f6325244aded5e35189"
when "darwin-arm64" then "ae0a54315aadf0225e9f45e79137ff15285120f806ffef20e1604a1f6e0a6614"
else
raise "CodeGPT: Unsupported system #{os}-#{arch}"
end
sha256 @@sha256
url @@url,
using: @@using
depends_on "git"
depends_on "zsh" => :optional
def install
filename = Codegpt.class_variable_get("@@filename")
bin.install filename => "codegpt"
end
test do
system "#{bin}/codegpt", "version"
end
end