File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 3131
3232echo " 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}' ) "
3534SHA_LINUX_X64=" $( curl -sfL " https://github.com/${REPO} /releases/download/${TAG} /attn-${TAG} -linux-x64.sha256" | awk ' {print $1}' ) "
3635SHA_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
4237if [ -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
4944fi
5045
51- echo " darwin-arm64: ${SHA_DARWIN_ARM64} "
5246echo " linux-x64: ${SHA_LINUX_X64} "
5347echo " darwin-arm64 app: ${SHA_DARWIN_ARM64_APP} "
5448
5549# --- Update Formula ---
5650
5751FORMULA=" $( 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
You can’t perform that action at this time.
0 commit comments