diff --git a/scripts/set-pusher-suffix.sh b/scripts/set-pusher-suffix.sh index 4f59e3f87cb6..c7a4fc03595f 100755 --- a/scripts/set-pusher-suffix.sh +++ b/scripts/set-pusher-suffix.sh @@ -4,8 +4,17 @@ # config file to be parsed for the suffix (relative to current project root) CONFIG_FILE="../Web-Expensify/_config.local.php" +# Export vars from the .env file +export $(grep -v '^#' .env | xargs) + # use the suffix only when the config file can be found if [ -f "$CONFIG_FILE" ]; then + # If we are pointing to the staging or production api don't add the suffix + if [[ $EXPENSIFY_URL == "https://www.expensify.com/" ]]; then + echo "Ignoring the PUSHER_DEV_SUFFIX since we are not pointing to the dev API" + exit 0 + fi + echo "Using PUSHER_DEV_SUFFIX from $CONFIG_FILE" PATTERN="PUSHER_DEV_SUFFIX.*'(.+)'"