Files
karuo-ai/01_卡资(金)/金仓_存储备份/脚本/handy_install_arm64.sh
2026-07-19 00:21:46 +08:00

23 lines
859 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# M4/M 芯片专用:安装原生 arm64 版 HandyHomebrew 可能装成 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简体中文"