-
Notifications
You must be signed in to change notification settings - Fork 0
/
.environment
15 lines (13 loc) · 975 Bytes
/
.environment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Statements in this file will be executed (sourced) by the shell in SSH
# sessions, in deploy hooks, in cron jobs, and in the application's runtime
# environment. This file must be placed in the root of the application, not
# necessarily the git repository's root. In case of multiple applications,
# each application can have its own .environment file.
# Allow executable app dependencies from Composer to be run from the path.
if [ -n "$PLATFORM_APP_DIR" -a -f "$PLATFORM_APP_DIR"/composer.json ] ; then
bin=$(composer config bin-dir --working-dir="$PLATFORM_APP_DIR" --no-interaction 2>/dev/null)
export PATH="${PLATFORM_APP_DIR}/${bin:-vendor/bin}:${PATH}"
fi
# Set default drush URI.
# See https://github.com/platformsh-templates/drupal9/pull/128
export DRUSH_OPTIONS_URI=$(echo $PLATFORM_ROUTES | base64 --decode | jq -r "to_entries | map(select(.value.upstream == \"$PLATFORM_APPLICATION_NAME\")) | sort_by(.value.primary, .key) | reverse | [.[].key] | first")