Skip to content

Commit e8fa14e

Browse files
committed
Renaming variable to line up with field name in bootconfig
1 parent 5e7a52b commit e8fa14e

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

install.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,35 @@ git submodule update
1313
git -C external/shared checkout -- samples/mobilesyncexplorer/bootconfig.json samples/accounteditor/bootconfig.json 2>/dev/null || true
1414

1515
# get react native
16-
pushd "libs/SalesforceReact"
17-
rm -rf node_modules
18-
rm yarn.lock
19-
yarn install
20-
./node_modules/.bin/react-native bundle --platform android --dev true --entry-file node_modules/react-native-force/test/alltests.js --bundle-output ../test/SalesforceReactTest/assets/index.android.bundle --assets-dest ../test/SalesforceReactTest/assets/
21-
popd
16+
# pushd "libs/SalesforceReact"
17+
# rm -rf node_modules
18+
# rm yarn.lock
19+
# yarn install
20+
# ./node_modules/.bin/react-native bundle --platform android --dev true --entry-file node_modules/react-native-force/test/alltests.js --bundle-output ../test/SalesforceReactTest/assets/index.android.bundle --assets-dest ../test/SalesforceReactTest/assets/
21+
# popd
2222

2323
# Apply bootconfig placeholder substitution. Usage:
2424
# apply_bootconfig_paths [sample_file] path1 path2 ...
25-
# First arg is sample path (or empty for no sample). If sample is set and a path does not exist, copy sample there. Then substitute env vars.
25+
# First arg is sample path (or empty for no sample). If sample is set, copy sample over each path (overwriting if present).
26+
# Then substitute env vars.
2627
apply_bootconfig_paths() {
2728
local sample_file=""
2829
[ -n "$1" ] && [ -f "$1" ] && sample_file="$1"
2930
shift
3031
while [ $# -gt 0 ]; do
3132
local bootconfig="$1"
3233
shift
33-
if [ -n "$sample_file" ] && [ ! -f "$bootconfig" ]; then
34+
if [ -n "$sample_file" ]; then
3435
mkdir -p "$(dirname "$bootconfig")"
3536
cp "$sample_file" "$bootconfig"
3637
fi
3738
if [ -f "$bootconfig" ]; then
38-
if [ -n "${MSDK_IOS_REMOTE_ACCESS_CLIENT_KEY:-}" ]; then
39-
gsed -i "s|__CONSUMER_KEY__|${MSDK_IOS_REMOTE_ACCESS_CLIENT_KEY}|g" "$bootconfig"
39+
# Substitute env vars if set
40+
if [ -n "${MSDK_ANDROID_REMOTE_ACCESS_CONSUMER_KEY:-}" ]; then
41+
gsed -i "s|__CONSUMER_KEY__|${MSDK_ANDROID_REMOTE_ACCESS_CONSUMER_KEY}|g" "$bootconfig"
4042
fi
41-
if [ -n "${MSDK_IOS_REMOTE_ACCESS_CALLBACK_URL:-}" ]; then
42-
gsed -i "s|__REDIRECT_URI__|${MSDK_IOS_REMOTE_ACCESS_CALLBACK_URL}|g" "$bootconfig"
43+
if [ -n "${MSDK_ANDROID_REMOTE_ACCESS_CALLBACK_URL:-}" ]; then
44+
gsed -i "s|__REDIRECT_URI__|${MSDK_ANDROID_REMOTE_ACCESS_CALLBACK_URL}|g" "$bootconfig"
4345
fi
4446
fi
4547
done
@@ -60,9 +62,9 @@ BOOTCONFIG_JSON_PATHS=(
6062
apply_bootconfig_paths "$BOOTCONFIG_SAMPLE" "${BOOTCONFIG_XML_PATHS[@]}"
6163
apply_bootconfig_paths "" "${BOOTCONFIG_JSON_PATHS[@]}"
6264

63-
if [ -z "${MSDK_IOS_REMOTE_ACCESS_CLIENT_KEY:-}" ] || [ -z "${MSDK_IOS_REMOTE_ACCESS_CALLBACK_URL:-}" ]; then
65+
if [ -z "${MSDK_ANDROID_REMOTE_ACCESS_CONSUMER_KEY:-}" ] || [ -z "${MSDK_ANDROID_REMOTE_ACCESS_CALLBACK_URL:-}" ]; then
6466
echo ""
65-
echo "Note: MSDK_IOS_REMOTE_ACCESS_CLIENT_KEY and/or MSDK_IOS_REMOTE_ACCESS_CALLBACK_URL are not set."
67+
echo "Note: MSDK_ANDROID_REMOTE_ACCESS_CONSUMER_KEY and/or MSDK_ANDROID_REMOTE_ACCESS_CALLBACK_URL are not set."
6668
echo "To run the sample applications, define these environment variables or ensure bootconfig.xml"
6769
echo "files exist (created from shared/bootconfig.xml.sample) with remoteAccessConsumerKey and oauthRedirectURI set."
6870
echo ""

0 commit comments

Comments
 (0)