Skip to content

Instantly share code, notes, and snippets.

@qoli
Created October 5, 2023 05:19
Show Gist options
  • Save qoli/09f9d11eda22effb25451d523d76d982 to your computer and use it in GitHub Desktop.
Save qoli/09f9d11eda22effb25451d523d76d982 to your computer and use it in GitHub Desktop.
#!/bin/bash
# 請確保你已經先安裝了 Xcode Command Line Tools
# 檢查參數是否提供新版本號
if [ -z "$1" ]; then
echo "請提供新版本號作為腳本參數。"
exit 1
fi
# 設定新版本號
new_version="$1"
# 取得腳本運行的目錄作為專案路徑
project_path=$(dirname "$0")
# 修改 MARKETING_VERSION
sed -i '' "s/MARKETING_VERSION = .*/MARKETING_VERSION = $new_version;/g" "$project_path/SyncNext.xcodeproj/project.pbxproj"
echo "已修改 MARKETING_VERSION 為:$new_version"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment