From 4067ba9c385a44811573c9bd93d3943697a665b2 Mon Sep 17 00:00:00 2001 From: kelin Date: Tue, 10 Feb 2026 19:26:23 -0500 Subject: [PATCH] Fix nested variable expansion in process_stack_env - Add eval expansion of references when populating stack .env files - Resolves PROJECTS_DIR=${STACKS_DIR} to actual path value - Ensures Docker Compose receives fully resolved paths, not variable references --- scripts/ez-homelab.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/ez-homelab.sh b/scripts/ez-homelab.sh index 9527126..2600ad0 100755 --- a/scripts/ez-homelab.sh +++ b/scripts/ez-homelab.sh @@ -180,9 +180,12 @@ process_stack_env() { # Get actual value from environment local actual_value="${!key}" - # If we have a value, use it; otherwise keep the example + # If we have a value, expand any nested variable references if [ -n "$actual_value" ]; then - echo "$key=$actual_value" >> "$temp_file" + # Use eval to expand nested ${VAR} references + local expanded_value + expanded_value=$(eval echo "\"$actual_value\"") + echo "$key=$expanded_value" >> "$temp_file" else echo "$line" >> "$temp_file" fi