From a4d329e57098b237761c92b43fe081e60d1b8f3e Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 21 Mar 2022 16:28:27 +0100 Subject: [PATCH] fix: [compose-core] ``$PROJECT_NAME`` was not available anymore in direct action Signed-off-by: Valentin Lab --- bin/compose-core | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/compose-core b/bin/compose-core index 4f42012..a32bd67 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -2725,7 +2725,7 @@ export -f run_service_relations _run_service_action_direct() { - local service="$1" action="$2" charm _dummy + local service="$1" action="$2" charm _dummy project_name shift; shift read-0 charm || true ## against 'set -e' that could be setup in parent scripts @@ -2735,6 +2735,9 @@ _run_service_action_direct() { return 1 fi + project_name=$(get_default_project_name) || return 1 + export PROJECT_NAME="$project_name" + export state_tmpdir ( set +e ## Prevents unwanted leaks from parent shell