Skip to content
Merged
Changes from 1 commit
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
31 changes: 31 additions & 0 deletions Formula/a/aicommit2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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"

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