<commit_before>#!/usr/bin/env bash
set -e

echo "EAS build pre-install script for profile: $EAS_BUILD_PROFILE"

if [[ $EAS_BUILD_PROFILE == "staging" ]]; then
  export CLIENT_ID="$STAGING_CLIENT_ID"
  export API="$STAGING_API"
  export FIREBASE_MEASUREMENT_ID="$STAGING_FIREBASE_MEASUREMENT_ID"
fi

if [[ $EAS_BUILD_PROFILE == "production" ]]; then
  export CLIENT_ID="$PRODUCTION_CLIENT_ID"
  export API="$PRODUCTION_API"
  export FIREBASE_MEASUREMENT_ID="$PRODUCTION_FIREBASE_MEASUREMENT_ID"
fi

if [[ $EAS_BUILD_PROFILE == "production" ]]; then
  echo "building google services files for production"

  echo $PRODUCTION_GOOGLE_SERVICES_ANDROID_BASE64 | base64 -d > ./google-services.json
  echo $PRODUCTION_GOOGLE_SERVICES_IOS_BASE64 | base64 -d > ./GoogleService-Info.plist
  export GOOGLE_MAPS_API_KEY_ANDROID="$PRODUCTION_GOOGLE_MAPS_API_KEY_ANDROID"
  export GOOGLE_MAPS_API_KEY_IOS="$PRODUCTION_GOOGLE_MAPS_API_KEY_IOS"
elif [[ $EAS_BUILD_PROFILE == "staging" ]]; then
  echo "building google services files for staging"

  echo $STAGING_GOOGLE_SERVICES_ANDROID_BASE64 | base64 -d > ./google-services.json
  echo $STAGING_GOOGLE_SERVICES_IOS_BASE64 | base64 -d > ./GoogleService-Info.plist
  export GOOGLE_MAPS_API_KEY_ANDROID="$STAGING_GOOGLE_MAPS_API_KEY_ANDROID"
  export GOOGLE_MAPS_API_KEY_IOS="$STAGING_GOOGLE_MAPS_API_KEY_IOS"
else
  echo "building google services files for development"

  echo $DEV_GOOGLE_SERVICES_ANDROID_BASE64 | base64 -d > ./google-services.json
  echo $DEV_GOOGLE_SERVICES_IOS_BASE64 | base64 -d > ./GoogleService-Info.plist
  #: staging map api keys are restricted to both staging and dev apps...
  export GOOGLE_MAPS_API_KEY_ANDROID="$STAGING_GOOGLE_MAPS_API_KEY_ANDROID"
  export GOOGLE_MAPS_API_KEY_IOS="$STAGING_GOOGLE_MAPS_API_KEY_IOS"
fi

echo "exporting env vars required at runtime to .env file"
echo "API=$API" >> .env
echo "CLIENT_ID=$CLIENT_ID" >> .env
echo "FACEBOOK_OAUTH_CLIENT_ID=$FACEBOOK_OAUTH_CLIENT_ID" >> .env
echo "GOOGLE_OAUTH_CLIENT_ID_IOS=$GOOGLE_OAUTH_CLIENT_ID_IOS" >> .env
echo "GOOGLE_OAUTH_CLIENT_ID_ANDROID=$GOOGLE_OAUTH_CLIENT_ID_ANDROID" >> .env

echo "installing npm deps for the common package"
cd ../common
npm i<commit_msg>fix(front): add dev and staging oauth client ids<commit_after>#!/usr/bin/env bash
set -e

echo "EAS build pre-install script for profile: $EAS_BUILD_PROFILE"

if [[ $EAS_BUILD_PROFILE == "staging" ]]; then
  export CLIENT_ID="$STAGING_CLIENT_ID"
  export API="$STAGING_API"
  export FIREBASE_MEASUREMENT_ID="$STAGING_FIREBASE_MEASUREMENT_ID"
fi

if [[ $EAS_BUILD_PROFILE == "production" ]]; then
  export CLIENT_ID="$PRODUCTION_CLIENT_ID"
  export API="$PRODUCTION_API"
  export FIREBASE_MEASUREMENT_ID="$PRODUCTION_FIREBASE_MEASUREMENT_ID"
fi

if [[ $EAS_BUILD_PROFILE == "production" ]]; then
  echo "building google services files for production"

  echo $PRODUCTION_GOOGLE_SERVICES_ANDROID_BASE64 | base64 -d > ./google-services.json
  echo $PRODUCTION_GOOGLE_SERVICES_IOS_BASE64 | base64 -d > ./GoogleService-Info.plist
  export GOOGLE_MAPS_API_KEY_ANDROID="$PRODUCTION_GOOGLE_MAPS_API_KEY_ANDROID"
  export GOOGLE_MAPS_API_KEY_IOS="$PRODUCTION_GOOGLE_MAPS_API_KEY_IOS"
  export GOOGLE_OAUTH_CLIENT_ID_ANDROID="$PRODUCTION_GOOGLE_OAUTH_CLIENT_ID_ANDROID"
  export GOOGLE_OAUTH_CLIENT_ID_IOS="$PRODUCTION_GOOGLE_OAUTH_CLIENT_ID_IOS"
elif [[ $EAS_BUILD_PROFILE == "staging" ]]; then
  echo "building google services files for staging"

  echo $STAGING_GOOGLE_SERVICES_ANDROID_BASE64 | base64 -d > ./google-services.json
  echo $STAGING_GOOGLE_SERVICES_IOS_BASE64 | base64 -d > ./GoogleService-Info.plist
  export GOOGLE_MAPS_API_KEY_ANDROID="$STAGING_GOOGLE_MAPS_API_KEY_ANDROID"
  export GOOGLE_MAPS_API_KEY_IOS="$STAGING_GOOGLE_MAPS_API_KEY_IOS"
  export GOOGLE_OAUTH_CLIENT_ID_ANDROID="$STAGING_GOOGLE_OAUTH_CLIENT_ID_ANDROID"
  export GOOGLE_OAUTH_CLIENT_ID_IOS="$STAGING_GOOGLE_OAUTH_CLIENT_ID_IOS"
else
  echo "building google services files for development"

  echo $DEV_GOOGLE_SERVICES_ANDROID_BASE64 | base64 -d > ./google-services.json
  echo $DEV_GOOGLE_SERVICES_IOS_BASE64 | base64 -d > ./GoogleService-Info.plist
  #: staging map api keys are restricted to both staging and dev apps...
  export GOOGLE_MAPS_API_KEY_ANDROID="$STAGING_GOOGLE_MAPS_API_KEY_ANDROID"
  export GOOGLE_MAPS_API_KEY_IOS="$STAGING_GOOGLE_MAPS_API_KEY_IOS"
  export GOOGLE_OAUTH_CLIENT_ID_ANDROID="$DEV_GOOGLE_OAUTH_CLIENT_ID_ANDROID"
  export GOOGLE_OAUTH_CLIENT_ID_IOS="$DEV_GOOGLE_OAUTH_CLIENT_ID_IOS"
fi

echo "exporting env vars required at runtime to .env file"
echo "API=$API" >> .env
echo "CLIENT_ID=$CLIENT_ID" >> .env
echo "FACEBOOK_OAUTH_CLIENT_ID=$FACEBOOK_OAUTH_CLIENT_ID" >> .env
echo "GOOGLE_OAUTH_CLIENT_ID_IOS=$GOOGLE_OAUTH_CLIENT_ID_IOS" >> .env
echo "GOOGLE_OAUTH_CLIENT_ID_ANDROID=$GOOGLE_OAUTH_CLIENT_ID_ANDROID" >> .env

echo "installing npm deps for the common package"
cd ../common
npm i
{'fraction_non_alphanumeric': 0.08879363135333741, 'fraction_numerical': 0.009797917942437232, 'mean_word_length': 7.1395348837209305, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5000785', 'n_tokens_mistral': 2011, 'n_tokens_neox': 1881, 'n_words': 330}