Skip to content

Commit 776e092

Browse files
authored
Fix in case of the file does not exist (#8258)
1 parent fe6e21a commit 776e092

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/docker/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ file_env PGADMIN_DEFAULT_PASSWORD
4040
export CONFIG_DISTRO_FILE_PATH="${PGADMIN_CUSTOM_CONFIG_DISTRO_FILE:-/pgadmin4/config_distro.py}"
4141
# Populate config_distro.py. This has some default config, as well as anything
4242
# provided by the user through the PGADMIN_CONFIG_* environment variables.
43-
# Only update the file on first launch. The empty file is created during the
43+
# Only update the file on first launch. The empty file is created only in default path during the
4444
# container build so it can have the required ownership.
45-
if [ "$(wc -m "${CONFIG_DISTRO_FILE_PATH}" | awk '{ print $1 }')" = "0" ]; then
45+
if [ ! -e "${CONFIG_DISTRO_FILE_PATH}" ] || [ "$(wc -m "${CONFIG_DISTRO_FILE_PATH}" 2>/dev/null | awk '{ print $1 }')" = "0" ]; then
4646
cat << EOF > "${CONFIG_DISTRO_FILE_PATH}"
4747
CA_FILE = '/etc/ssl/certs/ca-certificates.crt'
4848
LOG_FILE = '/dev/null'

0 commit comments

Comments
 (0)