File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,9 +75,12 @@ BUILD_DIR="$PROJECT_DIR/build"
7575ZIP_PATH=" $BUILD_DIR /$APP_NAME .zip"
7676APPCAST_PATH=" $PROJECT_DIR /appcast.xml"
7777
78- # Sparkle 工具路径
79- SPARKLE_BIN=" /opt/homebrew/Caskroom/sparkle/2.8.1/bin"
80- SIGN_UPDATE=" $SPARKLE_BIN /sign_update"
78+ # Sparkle 工具路径(自动查找已安装版本,避免硬编码版本号)
79+ SIGN_UPDATE=$( find /opt/homebrew/Caskroom/sparkle -name sign_update -type f 2> /dev/null | sort -V | tail -1)
80+ if [ -z " $SIGN_UPDATE " ]; then
81+ # 回退到 PATH 中的 sign_update(若通过其它方式安装)
82+ SIGN_UPDATE=$( command -v sign_update || true)
83+ fi
8184
8285# GitHub 仓库(优先从 origin 自动解析)
8386REMOTE_URL=$( git remote get-url origin 2> /dev/null || true)
@@ -111,9 +114,10 @@ if ! gh auth status &> /dev/null; then
111114 exit 1
112115fi
113116
114- if [ ! -f " $SIGN_UPDATE " ]; then
117+ if [ -z " $SIGN_UPDATE " ] || [ ! -f " $SIGN_UPDATE " ]; then
115118 log_error " 未找到 Sparkle sign_update 工具"
116119 echo " 请运行: brew install --cask sparkle"
120+ echo " (若已安装,请确认 /opt/homebrew/Caskroom/sparkle 下存在 sign_update)"
117121 exit 1
118122fi
119123
You can’t perform that action at this time.
0 commit comments