fix: provide default values for variables
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
f 2025-04-10 15:42:21 -03:00
parent d0191f1c49
commit 29a7d585dc

View File

@ -22,7 +22,7 @@ file_env() {
}
load_vars() {
if [ -n "${CMD_DB_PASSWORD}" ] ; then
if [ -n "${CMD_DB_PASSWORD:-""}" ] ; then
file_env "CMD_DB_PASSWORD"
fi
file_env "CMD_OAUTH2_CLIENT_SECRET"
@ -30,7 +30,7 @@ load_vars() {
}
main() {
set -e
set -eu
load_vars
mkdir -p "/hedgedoc/.npm" && \
@ -42,7 +42,7 @@ main() {
main
if [ -z "${CMD_DB_URL}" ] ; then
if [ -z "${CMD_DB_URL:-""}" ] ; then
# TODO: support databases other than postgres and sqlite
export CMD_DB_URL="${postgres://$CMD_DB_USER:$CMD_DB_PASSWORD@$CMD_DB_HOST:5432/$CMD_DB_NAME}"
fi
@ -55,4 +55,4 @@ if [ ! "${1-}" == "-e" ]; then
/usr/local/bin/docker-entrypoint.sh npm start
fi
set +e
set +eu