Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Formula/a/aicommit2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
class Aicommit2 < Formula
desc "Reactive CLI that generates commit messages for Git and Jujutsu with AI"
homepage "https://github.com/tak-bro/aicommit2"
url "https://registry.npmjs.org/aicommit2/-/aicommit2-2.4.11.tgz"
sha256 "f70af3cebb289fbc83ef04adad59be45014e2c068de0a6b52328e831daaf330e"
license "MIT"

bottle do
sha256 cellar: :any_skip_relocation, all: "9fe23b4d59bc66c7ad548597a4a1924c199059535324aa66bbeb55051d707496"
end

depends_on "node"

def install
system "npm", "install", *std_npm_args
bin.install_symlink Dir["#{libexec}/bin/*"]
end

test do
assert_match version.to_s, shell_output("#{bin}/aicommit2 --version")
assert_match version.to_s, shell_output("#{bin}/aic2 --version")

assert_match "Not in a Git repository", shell_output("#{bin}/aicommit2 2>&1", 1)

system "git", "init"
assert_match "No staged changes found", shell_output("#{bin}/aicommit2 2>&1", 1)

(testpath/"test.txt").write "test content"
system "git", "add", "test.txt"

assert_match "Please set at least one API key", shell_output("#{bin}/aicommit2 2>&1", 1)
shell_output("#{bin}/aicommit2 config set OPENAI.key=sk-test")
assert_match "key: 'sk-test'", shell_output("#{bin}/aicommit2 config get OPENAI")
end
end
Loading