Skip to content

Commit 1854fca

Browse files
authored
Merge pull request #250601 from tak-bro/aicommit2
aicommit2 2.4.11 (new formula)
2 parents fa60a8c + 8523b3c commit 1854fca

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Formula/a/aicommit2.rb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
class Aicommit2 < Formula
2+
desc "Reactive CLI that generates commit messages for Git and Jujutsu with AI"
3+
homepage "https://github.com/tak-bro/aicommit2"
4+
url "https://registry.npmjs.org/aicommit2/-/aicommit2-2.4.11.tgz"
5+
sha256 "f70af3cebb289fbc83ef04adad59be45014e2c068de0a6b52328e831daaf330e"
6+
license "MIT"
7+
8+
bottle do
9+
sha256 cellar: :any_skip_relocation, all: "9fe23b4d59bc66c7ad548597a4a1924c199059535324aa66bbeb55051d707496"
10+
end
11+
12+
depends_on "node"
13+
14+
def install
15+
system "npm", "install", *std_npm_args
16+
bin.install_symlink Dir["#{libexec}/bin/*"]
17+
end
18+
19+
test do
20+
assert_match version.to_s, shell_output("#{bin}/aicommit2 --version")
21+
assert_match version.to_s, shell_output("#{bin}/aic2 --version")
22+
23+
assert_match "Not in a Git repository", shell_output("#{bin}/aicommit2 2>&1", 1)
24+
25+
system "git", "init"
26+
assert_match "No staged changes found", shell_output("#{bin}/aicommit2 2>&1", 1)
27+
28+
(testpath/"test.txt").write "test content"
29+
system "git", "add", "test.txt"
30+
31+
assert_match "Please set at least one API key", shell_output("#{bin}/aicommit2 2>&1", 1)
32+
shell_output("#{bin}/aicommit2 config set OPENAI.key=sk-test")
33+
assert_match "key: 'sk-test'", shell_output("#{bin}/aicommit2 config get OPENAI")
34+
end
35+
end

0 commit comments

Comments
 (0)