From 169ca25d67ae492a2458f34f8975641972e9bee2 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 16 Aug 2022 10:36:54 +0200 Subject: [PATCH] do not report from dc when env file does not exist --- dc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dc b/dc index 6f7a9d49..b07b06ef 100755 --- a/dc +++ b/dc @@ -11,7 +11,9 @@ cwd="$(dirname -- "$0";)"; # get portal modules configuration from .env file (if defined more than once, the last one is used) -PORTAL_MODULES=$(grep -e "^PORTAL_MODULES=" ${cwd}/.env | tail -1 | sed "s/PORTAL_MODULES=//") +if [[ -f "${cwd}/.env" ]]; then + PORTAL_MODULES=$(grep -e "^PORTAL_MODULES=" ${cwd}/.env | tail -1 | sed "s/PORTAL_MODULES=//") +fi # include base docker compose file COMPOSE_FILES="-f ${cwd}/docker-compose.yml"