summaryrefslogtreecommitdiff
path: root/platform/ios/app/insert_access_token.sh
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/app/insert_access_token.sh')
-rwxr-xr-xplatform/ios/app/insert_access_token.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/platform/ios/app/insert_access_token.sh b/platform/ios/app/insert_access_token.sh
new file mode 100755
index 0000000000..3a3a776443
--- /dev/null
+++ b/platform/ios/app/insert_access_token.sh
@@ -0,0 +1,17 @@
+if [[ "$CI" ]]; then
+ echo "CI environment, access token not required"
+ exit 0
+else
+ echo "Inserting Mapbox access token..."
+ token_file=~/.mapbox
+ token_file2=~/mapbox
+ token="$(cat $token_file 2>/dev/null || cat $token_file2 2>/dev/null)"
+ if [ "$token" ]; then
+ plutil -replace MGLMapboxAccessToken -string $token "$TARGET_BUILD_DIR/$INFOPLIST_PATH"
+ echo "Token insertion successful"
+ else
+ echo \'error: Missing Mapbox access token\'
+ echo "error: Get an access token from <https://www.mapbox.com/studio/account/tokens/>, then create a new file at $token_file that contains the access token."
+ exit 1
+ fi
+fi