1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix xcode-select

The old Xcode sticks around, so make sure we sort in reverse to pick the newer
version. Technically we should use something like sort -Vr, but -V doesn't exist
on macOS. But that won't be a problem until Xcode 100, which my great great
grand children can worry about.
This commit is contained in:
Ilija Tovilo
2025-12-13 20:27:14 +01:00
parent cb413b5d5f
commit 6cdb8bf0a2

View File

@@ -8,7 +8,7 @@ runs:
label=$((softwareupdate -l 2>/dev/null | grep 'Label:' | grep -o 'Command Line Tools for Xcode.*' | head -1) || echo '')
if [ -n "$label" ]; then
softwareupdate -i "$label"
xcode_path=$(ls -1 '/Applications' | grep 'Xcode_.*\.app' | head -1)
xcode_path=$(ls -1 '/Applications' | grep 'Xcode_.*\.app' | sort -r | head -1)
sudo xcode-select -s "/Applications/$xcode_path"
else
echo "Not found."