Skip to content

Commit

Permalink
Fix issue with mac/linux (#5562)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexd-bes authored Apr 4, 2024
1 parent 9cb809e commit cb316ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/bash/downloadEnvironmentVariables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ load_env_file_from_bw () {

# Replace any instances of the placeholder [deployment-name] in the .env file with the actual deployment
# name (e.g. [deployment-name]-api.tupaia.org -> specific-deployment-api.tupaia.org)
sed -i "" "s/\[deployment-name\]/${DEPLOYMENT_NAME}/g" "${ENV_FILE_PATH}"
sed -i -e "s/\[deployment-name\]/${DEPLOYMENT_NAME}/g" "${ENV_FILE_PATH}"


if [[ "${DEPLOYMENT_NAME}" == *-e2e || "${DEPLOYMENT_NAME}" == e2e ]]; then
# Update e2e environment variables
if [[ ${FILE_NAME} == "aggregation" ]]; then
sed -i "" 's/^AGGREGATION_URL_PREFIX="?dev-"?$/AGGREGATION_URL_PREFIX=e2e-/g' ${ENV_FILE_PATH}
sed -i -e 's/^AGGREGATION_URL_PREFIX="?dev-"?$/AGGREGATION_URL_PREFIX=e2e-/g' ${ENV_FILE_PATH}
fi
fi

if [[ "${DEPLOYMENT_NAME}" == dev ]]; then
# Update dev specific environment variables
# (removes ###DEV_ONLY### prefixes, leaving the key=value pair uncommented)
# (after removing prefix, if there are duplicate keys, dotenv uses the last one in the file)
sed -i "" 's/^###DEV_ONLY###//g' ${ENV_FILE_PATH}
sed -i -e 's/^###DEV_ONLY###//g' ${ENV_FILE_PATH}
fi


Expand Down

0 comments on commit cb316ed

Please sign in to comment.