From a894f72c09c3ba0f3a558f93fcce105cbec7efc3 Mon Sep 17 00:00:00 2001 From: Matthew Lopez <73856503+MatthewL246@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:38:13 -0400 Subject: [PATCH] Create empty local.env files before running docker compose down Fixes #91 --- scripts/setup-environment.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/setup-environment.sh b/scripts/setup-environment.sh index c4b75f7..f262b85 100755 --- a/scripts/setup-environment.sh +++ b/scripts/setup-environment.sh @@ -51,6 +51,13 @@ if ls ./*.local.env >/dev/null 2>&1; then fi print_info "Stopping containers and removing existing local environment files..." + # If a new server was added in an update, `docker compose down` will fail unless the necessary local environment + # files exist, even if the new server isn't running. The contents of the files don't matter, so they can be empty. + for file in *.env; do + if [ -f "$file" ]; then + touch "${file%%.*}.local.env" + fi + done compose_no_progress down rm ./*.local.env rm "$git_base_dir/.env"