Skip to content

Commit

Permalink
Merge pull request #13297 from Expensify/neil-staging-pusher-suffix
Browse files Browse the repository at this point in the history
[No QA] Prevent setting a pusher suffix for the staging or production api
  • Loading branch information
Beamanator authored Dec 6, 2022
2 parents 36a009b + c846829 commit d7bc650
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/set-pusher-suffix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@
# config file to be parsed for the suffix (relative to current project root)
CONFIG_FILE="../Web-Expensify/_config.local.php"

if [ -f ".env" ]; then
# Export vars from the .env file to access the $EXPENSIFY_URL
export $(grep -v '^#' .env | xargs)
fi

# 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.*'(.+)'"
Expand Down

0 comments on commit d7bc650

Please sign in to comment.