File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,10 @@ function output_info {
9494 output_tagged_string " $BG_B " " INFO" " $1 "
9595}
9696
97+ function output_warning {
98+ output_tagged_string " $BG_Y " " INFO" " $1 "
99+ }
100+
97101export BG_R
98102export BG_G
99103export BG_Y
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ # Enable auto-export
4+ set -a
5+
6+ if [ -f " .env" ]; then
7+ source " .env"
8+ fi
9+
10+ # Disable auto-export
11+ set +a
12+
313HOP_PATH=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd)
414TOOLKIT_PATH=$( dirname " $HOP_PATH " )
515
@@ -147,6 +157,16 @@ function pick_one_virtual_host_from_file() {
147157
148158 HOST_STRING=$( sed -nr ' s/.*VIRTUAL_HOST=(.*)/\1/p' " $FILE " )
149159
160+ # Trim double quotes from HOST_STRING
161+ HOST_STRING=$( echo " $HOST_STRING " | tr -d ' "' )
162+
163+ # Pipe HOST_STRING through envsubst if available
164+ if command -v envsubst & > /dev/null; then
165+ HOST_STRING=$( echo " $HOST_STRING " | envsubst)
166+ else
167+ >&2 output_warning " envsubst not found. Skipping environment variable substitution."
168+ fi
169+
150170 IFS=" ," read -ra HOSTS <<< " $HOST_STRING"
151171
152172 for HOST_ENTRY in " ${HOSTS[@]} " ; do
You can’t perform that action at this time.
0 commit comments