Skip to content

Commit 8d1c81d

Browse files
ci: Try to remove unused Xcode dirs
1 parent 600edc9 commit 8d1c81d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/ci/scripts/select-xcode.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,21 @@ IFS=$'\n\t'
77
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
88

99
if isMacOS; then
10+
# This additional step is to try to remove an Xcode we aren't using because each one is HUGE
11+
old_xcode="$(xcode-select --print-path)"
12+
old_xcode="${old_xcode%/*}" # pop a dir
13+
old_xcode="${old_xcode%/*}" # twice
14+
if [[ $old_xcode =~ $SELECT_XCODE ]]; then
15+
echo "xcode-select.sh's brutal hack may not be necessary?"
16+
exit 1
17+
elif [[ $SELECT_XCODE =~ "16" ]]; then
18+
echo "Using Xcode 16? Please fix xcode-select.sh"
19+
exit 1
20+
fi
21+
if [ $CI ]; then # just in case someone sources this on their real computer
22+
sudo rm -rf "${old_xcode}"
23+
xcode_16="${old_xcode:%/*}/Xcode-16.0.0.app"
24+
sudo rm -rf "${xcode_16}"
25+
fi
1026
sudo xcode-select -s "${SELECT_XCODE}"
1127
fi

0 commit comments

Comments
 (0)