reef-technologies / cookiecutter-rt-django

CookieCutter template for Django application projects with docker-compose etc.
BSD 3-Clause "New" or "Revised" License
19 stars 24 forks source link

Backup script partially fails if env var not set #58

Closed agoncharov-reef closed 3 years ago

agoncharov-reef commented 3 years ago

When not having EMAIL_TARGET env var set, running

if [ -n "${EMAIL_HOST}" ] && [ -n "${EMAIL_TARGET}" ]; then

fails with:

bin/backup-db.sh: line 36: EMAIL_TARGET: unbound variable

One possible solution is to change #!/bin/bash -eu to #!/bin/bash -e, or do more advanced check for undefined variables.

ppolewicz commented 3 years ago
if [ -n "${EMAIL_HOST:-}" ] && [ -n "${EMAIL_TARGET:-}" ]; then