Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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