File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments