Skip to content

Commit 6cdb8bf

Browse files
committed
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.
1 parent cb413b5 commit 6cdb8bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/actions/macos-update-clang/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ runs:
88
label=$((softwareupdate -l 2>/dev/null | grep 'Label:' | grep -o 'Command Line Tools for Xcode.*' | head -1) || echo '')
99
if [ -n "$label" ]; then
1010
softwareupdate -i "$label"
11-
xcode_path=$(ls -1 '/Applications' | grep 'Xcode_.*\.app' | head -1)
11+
xcode_path=$(ls -1 '/Applications' | grep 'Xcode_.*\.app' | sort -r | head -1)
1212
sudo xcode-select -s "/Applications/$xcode_path"
1313
else
1414
echo "Not found."

0 commit comments

Comments
 (0)