From 42afae776eb75480d657cfea7732e0e97d37502b Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Thu, 12 Mar 2020 15:19:46 +0100 Subject: [PATCH] fix: some compose variables would incorrectly be shown as empty These variable are valued after the displaying code. Signed-off-by: Valentin Lab --- bin/compose | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/compose b/bin/compose index a88c59b..563c56d 100755 --- a/bin/compose +++ b/bin/compose @@ -954,6 +954,7 @@ load_env() { if [ -z "$COMPOSE_LAUNCHER_OPTS" ]; then mk_docker_run_options "$@" || return 1 else + set_os || return 1 while read-0 opt; do if [[ "$opt" == "!env:"* ]]; then opt="${opt##!env:}" @@ -986,9 +987,7 @@ run() { local os docker_run_opts load_env "$@" || return 1 - [ -n "$DEBUG" ] && show_env - - set_os || return 1 + [ -n "$DEBUG" ] && show_env >&2 if [ -n "$ARG_COMPOSE_FILE" ]; then array_read-0 cmd_args < \ @@ -1041,8 +1040,8 @@ depends docker cat readlink sed realpath tee sed grep tail ansi_color "${ansi_color:-tty}" if [ "$SHOW_ENV" ]; then - load_env || return 1 - show_env + load_env "$@" || return 1 + show_env >&2 exit 0 fi