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
This commit is contained in:
2026-02-10 19:26:23 -05:00
parent f318170d02
commit 4067ba9c38

View File

@@ -180,9 +180,12 @@ process_stack_env() {
# Get actual value from environment # Get actual value from environment
local actual_value="${!key}" 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 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 else
echo "$line" >> "$temp_file" echo "$line" >> "$temp_file"
fi fi