23 lines
859 B
Bash
Executable File
23 lines
859 B
Bash
Executable File
#!/usr/bin/env bash
|
||
# M4/M 芯片专用:安装原生 arm64 版 Handy(Homebrew 可能装成 x86_64 导致转录为空)
|
||
set -euo pipefail
|
||
VER="${1:-0.8.3}"
|
||
DMG="/tmp/Handy_${VER}_aarch64.dmg"
|
||
URL="https://github.com/cjpais/Handy/releases/download/v${VER}/Handy_${VER}_aarch64.dmg"
|
||
|
||
killall Handy 2>/dev/null || true
|
||
curl -fL -o "$DMG" "$URL"
|
||
hdiutil attach "$DMG" -nobrowse -quiet
|
||
VOL=$(ls /Volumes | rg -i '^Handy' | head -1)
|
||
rm -rf /Applications/Handy.app
|
||
ditto "/Volumes/$VOL/Handy.app" /Applications/Handy.app
|
||
hdiutil detach "/Volumes/$VOL" -quiet
|
||
xattr -cr /Applications/Handy.app
|
||
|
||
ARCH=$(file /Applications/Handy.app/Contents/MacOS/Handy)
|
||
echo "$ARCH"
|
||
echo "$ARCH" | rg -q arm64 || { echo "❌ 非 arm64,请检查"; exit 1; }
|
||
|
||
bash "$(dirname "$0")/handy_apply_chinese_macos.sh"
|
||
echo "✅ arm64 Handy 已安装,快捷键 ⌘1(简体中文)"
|