File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
# This script selects the Xcode instance to use.
3
+ # It also tries to do some cleanup in CI jobs of unused Xcodes.
3
4
4
5
set -euo pipefail
5
6
IFS=$' \n\t '
6
7
7
8
source " $( cd " $( dirname " $0 " ) " && pwd) /../shared.sh"
8
9
9
10
if isMacOS; then
11
+ # This additional step is to try to remove an Xcode we aren't using because each one is HUGE
12
+ old_xcode=" $( xcode-select --print-path) "
13
+ old_xcode=" ${old_xcode%/* } " # pop a dir
14
+ old_xcode=" ${old_xcode%/* } " # twice
15
+ if [[ $old_xcode =~ $SELECT_XCODE ]]; then
16
+ echo " xcode-select.sh's brutal hack may not be necessary?"
17
+ exit 1
18
+ elif [[ $SELECT_XCODE =~ " 16" ]]; then
19
+ echo " Using Xcode 16? Please fix xcode-select.sh"
20
+ exit 1
21
+ fi
22
+ if [ $CI ]; then # just in case someone sources this on their real computer
23
+ sudo rm -rf " ${old_xcode} "
24
+ xcode_16=" ${old_xcode%/* } /Xcode-16.0.0.app"
25
+ sudo rm -rf " ${xcode_16} "
26
+ fi
10
27
sudo xcode-select -s " ${SELECT_XCODE} "
11
28
fi
You can’t perform that action at this time.
0 commit comments