Skip to content

Commit 233c2f3

Browse files
committed
Fix brew formula to use tarball and set version
1 parent 2551f9d commit 233c2f3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ SHELL := /bin/bash
66
build:
77
set -e
88
mkdir -p bin
9-
VERSION=$$(git describe --tags --always --dirty || echo "dev")
9+
if [ -z "$$VERSION" ]; then \
10+
VERSION=$$(git describe --tags --always --dirty || echo "dev"); \
11+
fi
1012
echo "Building version $${VERSION}"
1113
go build -ldflags "-X main.Version=$${VERSION}" -o bin/aicommit ./cmd/aicommit

brew/aicommit.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
class Aicommit < Formula
22
desc "AI-powered commit message generator"
33
homepage "https://github.com/coder/aicommit"
4-
url "https://github.com/coder/aicommit.git", revision: "HEAD"
5-
version "0.0.0" # This will be overridden by the git describe in the Makefile
4+
version "0.6.2"
5+
url "https://github.com/coder/aicommit/archive/refs/tags/v#{version}.tar.gz"
6+
sha256 "04a980875e97aebc0f7bbeaa183aa5542b18c6e009505babbd494fe0fe62b18e"
67
license "CC0-1.0"
78

89
depends_on "go" => "1.21"
910
depends_on "make" => :build
1011

1112
def install
12-
system "git", "pull"
13-
system "make", "build"
13+
version = "v#{version}"
14+
ENV["VERSION"] = version
15+
system "make", "build", "VERSION=#{version}"
1416
bin.install "bin/aicommit"
1517
end
1618

0 commit comments

Comments
 (0)