-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectDefaultXcode.sh
More file actions
31 lines (20 loc) · 923 Bytes
/
SelectDefaultXcode.sh
File metadata and controls
31 lines (20 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# to make sure that any command that fails in turn return a non zero status and does not continue further
set -e
# get framework path from command line or use the current working directory as the path.Replace EXTERNAL_FRAMEWORK_NAME with
# the name of the corresponding framework.
if [ $# -eq 0 ] ; then
FRAMEWORK_PATH=$(pwd)/EXTERNAL_FRAMEWORK_NAME.framework/
echo "Using the current working directory as the framework path which is $FRAMEWORK_PATH"
else
FRAMEWORK_PATH=$1
fi
#navigate to the module map
cd "$FRAMEWORK_PATH/Modules/"
#find xcode path and replace it with the default
DEFAULT_XCODE_PATH="$(xcode-select -p)"
IFS='/'
read -ra ARRAY <<< "$DEFAULT_XCODE_PATH"
XCODE_COMPONENT=${ARRAY[2]}
# i have specified a default string to be replaced , you have to change it based on your requirement.
STRING_TO_BE_REPLACED="Xcode.app"
sed -i '' "s/$STRING_TO_BE_REPLACED/$XCODE_COMPONENT/g" module.modulemap