Skip to content

Commit cf9f890

Browse files
Homebrew formula: install .app bundle on macOS instead of bare binary
Downloads the .app.zip on macOS so the formula gives the full native experience (dock icon, window chrome) like the npm package does. Binary is symlinked from inside the bundle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 74f858e commit cf9f890

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

homebrew/attn.rb.template

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class Attn < Formula
66

77
on_macos do
88
on_arm do
9-
url "https://github.com/lightsofapollo/attn/releases/download/v#{version}/attn-v#{version}-darwin-arm64"
10-
sha256 "%%SHA256_DARWIN_ARM64%%"
9+
url "https://github.com/lightsofapollo/attn/releases/download/v#{version}/attn-v#{version}-darwin-arm64.app.zip"
10+
sha256 "%%SHA256_DARWIN_ARM64_APP%%"
1111
end
1212
end
1313

@@ -19,12 +19,17 @@ class Attn < Formula
1919
end
2020

2121
def install
22-
downloaded = Dir["attn-v*"].first
23-
if downloaded
24-
mv downloaded, "attn"
22+
if OS.mac?
23+
prefix.install "attn.app"
24+
bin.install_symlink prefix/"attn.app/Contents/MacOS/attn"
25+
else
26+
downloaded = Dir["attn-v*"].first
27+
if downloaded
28+
mv downloaded, "attn"
29+
end
30+
chmod 0755, "attn"
31+
bin.install "attn"
2532
end
26-
chmod 0755, "attn"
27-
bin.install "attn"
2833
end
2934

3035
test do

homebrew/update-tap.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,9 @@ fi
3131

3232
echo "Fetching SHA256 checksums for ${TAG}..."
3333

34-
SHA_DARWIN_ARM64="$(curl -sfL "https://github.com/${REPO}/releases/download/${TAG}/attn-${TAG}-darwin-arm64.sha256" | awk '{print $1}')"
3534
SHA_LINUX_X64="$(curl -sfL "https://github.com/${REPO}/releases/download/${TAG}/attn-${TAG}-linux-x64.sha256" | awk '{print $1}')"
3635
SHA_DARWIN_ARM64_APP="$(curl -sfL "https://github.com/${REPO}/releases/download/${TAG}/attn-${TAG}-darwin-arm64.app.zip.sha256" | awk '{print $1}')"
3736

38-
if [ -z "$SHA_DARWIN_ARM64" ]; then
39-
echo "Failed to fetch darwin-arm64 SHA256" >&2
40-
exit 1
41-
fi
4237
if [ -z "$SHA_LINUX_X64" ]; then
4338
echo "Failed to fetch linux-x64 SHA256" >&2
4439
exit 1
@@ -48,15 +43,14 @@ if [ -z "$SHA_DARWIN_ARM64_APP" ]; then
4843
exit 1
4944
fi
5045

51-
echo " darwin-arm64: ${SHA_DARWIN_ARM64}"
5246
echo " linux-x64: ${SHA_LINUX_X64}"
5347
echo " darwin-arm64 app: ${SHA_DARWIN_ARM64_APP}"
5448

5549
# --- Update Formula ---
5650

5751
FORMULA="$(sed \
5852
-e "s/%%VERSION%%/${VERSION}/g" \
59-
-e "s/%%SHA256_DARWIN_ARM64%%/${SHA_DARWIN_ARM64}/g" \
53+
-e "s/%%SHA256_DARWIN_ARM64_APP%%/${SHA_DARWIN_ARM64_APP}/g" \
6054
-e "s/%%SHA256_LINUX_X64%%/${SHA_LINUX_X64}/g" \
6155
"$FORMULA_TEMPLATE")"
6256

0 commit comments

Comments
 (0)