-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·51 lines (43 loc) · 1.73 KB
/
install.sh
File metadata and controls
executable file
·51 lines (43 loc) · 1.73 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# set -x
#
# Run this script before working with the SalesforceMobileSDK-Hybrid Xcode workspace.
#
# Sync submodules
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"
git submodule init
git submodule sync
git submodule update
# Restore bootconfig.json in shared submodule to committed placeholders
git -C external/shared checkout -- samples/mobilesyncexplorer/bootconfig.json samples/accounteditor/bootconfig.json 2>/dev/null || true
# Create test_credentials.json if needed to avoid build errors
if [ ! -f "shared/test/test_credentials.json" ]
then
cp shared/test/test_credentials.json.sample shared/test/test_credentials.json
fi
# Prepare cordova.js
pushd "external/cordova"
npm install
npm run prepare
popd
# Substitute env vars if set in bootconfig.json
BOOTCONFIG_JSON_PATHS=(
"external/shared/samples/mobilesyncexplorer/bootconfig.json"
"external/shared/samples/accounteditor/bootconfig.json"
)
for bootconfig in "${BOOTCONFIG_JSON_PATHS[@]}"; do
if [ -n "${MSDK_IOS_REMOTE_ACCESS_CONSUMER_KEY:-}" ]; then
gsed -i "s|__CONSUMER_KEY__|${MSDK_IOS_REMOTE_ACCESS_CONSUMER_KEY}|g" "$bootconfig"
fi
if [ -n "${MSDK_IOS_REMOTE_ACCESS_CALLBACK_URL:-}" ]; then
gsed -i "s|__REDIRECT_URI__|${MSDK_IOS_REMOTE_ACCESS_CALLBACK_URL}|g" "$bootconfig"
fi
done
if [ -z "${MSDK_IOS_REMOTE_ACCESS_CONSUMER_KEY:-}" ] || [ -z "${MSDK_IOS_REMOTE_ACCESS_CALLBACK_URL:-}" ]; then
echo ""
echo "Note: MSDK_IOS_REMOTE_ACCESS_CONSUMER_KEY and/or MSDK_IOS_REMOTE_ACCESS_CALLBACK_URL are not set."
echo "To run the sample applications, define these environment variables or ensure bootconfig.json"
echo "files have remoteAccessConsumerKey and oauthRedirectURI set."
echo ""
fi