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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user