Skip to content

Commit e3edc54

Browse files
Merge branch 'master' into feature/extend-git-commands
2 parents 42c8746 + 1c16ca2 commit e3edc54

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

bin/_helpers

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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" "WARNING" "$1"
99+
}
100+
97101
export BG_R
98102
export BG_G
99103
export BG_Y

bin/proxy

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/env bash
22

3+
# Enable auto-export
4+
set -a
5+
6+
if [ -f ".env" ]; then
7+
# shellcheck source=/dev/null
8+
source ".env"
9+
fi
10+
11+
# Disable auto-export
12+
set +a
13+
314
HOP_PATH=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
415
TOOLKIT_PATH=$(dirname "$HOP_PATH")
516

@@ -147,6 +158,16 @@ function pick_one_virtual_host_from_file() {
147158

148159
HOST_STRING=$(sed -nr 's/.*VIRTUAL_HOST=(.*)/\1/p' "$FILE")
149160

161+
# Trim double quotes from HOST_STRING
162+
HOST_STRING=$(echo "$HOST_STRING" | tr -d '"')
163+
164+
# Pipe HOST_STRING through envsubst if available
165+
if command -v envsubst &> /dev/null; then
166+
HOST_STRING=$(echo "$HOST_STRING" | envsubst)
167+
else
168+
>&2 output_warning "envsubst not found. Skipping environment variable substitution."
169+
fi
170+
150171
IFS="," read -ra HOSTS <<< "$HOST_STRING"
151172

152173
for HOST_ENTRY in "${HOSTS[@]}"; do

0 commit comments

Comments
 (0)