Skip to content

Commit

Permalink
Add xcode version check to bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
vvolkgang committed Dec 18, 2024
1 parent 7f150f5 commit 139e6cc
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,31 @@ set -euo pipefail
mint bootstrap

mint run xcodegen xcodegen
echo "✅ Bootstrapped!"

# Check Xcode version matches .xcode-version
# handle script being called from repo root or Scripts folder
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
repo_root=$(dirname "$script_dir")
xcode_version_file="$repo_root/.xcode-version"

if [ ! -f "$xcode_version_file" ]; then
echo "❌ .xcode-version file not found"
exit 1
fi

required_version=$(cat "$xcode_version_file")
current_version=$(system_profiler SPDeveloperToolsDataType | grep "Xcode:" | awk '{print $2}')
if [ -z "$current_version" ]; then
echo "❌ Could not determine current Xcode version. Is Xcode installed?"
exit 1
fi

if [ "$current_version" != "$required_version" ]; then
echo "🟡 Xcode version mismatch!"
echo "Required version: $required_version"
echo "Current version: $current_version"
exit 0
fi

echo "✅ Xcode version $current_version matches required version"

0 comments on commit 139e6cc

Please sign in to comment.