Skip to content

Commit 6843a8b

Browse files
committed
simplify iteration through environmental variables
1 parent 559ff64 commit 6843a8b

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

pkg/docker/entrypoint.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,9 @@ DEFAULT_BINARY_PATHS = {
5454
}
5555
EOF
5656

57-
# This is a bit kludgy, but necessary as the container uses BusyBox/ash as
58-
# it's shell and not bash which would allow a much cleaner implementation
59-
for var in $(env | grep "^PGADMIN_CONFIG_" | cut -d "=" -f 1); do
60-
# shellcheck disable=SC2086
61-
# shellcheck disable=SC2046
62-
echo ${var#PGADMIN_CONFIG_} = $(eval "echo \$$var") >> "${CONFIG_DISTRO_FILE_PATH}"
57+
# Iterate over PGADMIN_CONFIG_* environment variables and writes them to the config file
58+
for var in "${!PGADMIN_CONFIG_@}"; do
59+
echo "${var#PGADMIN_CONFIG_} = ${!var}" >> "${CONFIG_DISTRO_FILE_PATH}"
6360
done
6461
fi
6562

0 commit comments

Comments
 (0)