1 | # to make sure that any command that fails in turn return a non zero status and does not continue further
|
2 |
|
3 | set -e
|
4 |
|
5 | # get framework path from command line or use the current working directory as the path
|
6 |
|
7 | if [ $# -eq 0 ] ; then
|
8 | FRAMEWORK_PATH=$(pwd)/Razorpay.framework/
|
9 | echo "Using the current working directory as the framework path which is $FRAMEWORK_PATH"
|
10 | else
|
11 | FRAMEWORK_PATH=$1
|
12 | fi
|
13 |
|
14 | #navigate to the module map
|
15 |
|
16 | cd "$FRAMEWORK_PATH/Modules/"
|
17 |
|
18 | #find xcode path and replace it with the default
|
19 |
|
20 | DEFAULT_XCODE_PATH="$(xcode-select -p)"
|
21 | IFS='/'
|
22 | read -ra ARRAY <<< "$DEFAULT_XCODE_PATH"
|
23 | XCODE_COMPONENT=${ARRAY[2]}
|
24 | STRING_TO_BE_REPLACED="Xcode.app"
|
25 | sed -i '' "s/$STRING_TO_BE_REPLACED/$XCODE_COMPONENT/g" module.modulemap
|