fix: expand env vars and check absolute paths in build_reference_tree

The build_reference_tree() function was prepending config_dir to all
'into' paths without expanding environment variables or checking if the
result was absolute. This caused paths like /workspace/ai//workspace/ComfyUI
instead of /workspace/ComfyUI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-25 10:55:57 +01:00
parent c31b1e87bd
commit 60fcc359a4

View File

@@ -724,8 +724,17 @@ build_reference_tree() {
# Determine installation directory
local lib_dir
if [[ -n "$into" ]]; then
local config_dir=$(dirname "$(realpath "${effective_config}")")
lib_dir="$config_dir/$into"
# Expand environment variables
local expanded_into
expanded_into=$(expand_env_vars "$into" 2>/dev/null) || expanded_into="$into"
# Check if expanded path is absolute
if [[ "$expanded_into" == /* ]]; then
lib_dir="$expanded_into"
else
local config_dir=$(dirname "$(realpath "${effective_config}")")
lib_dir="$config_dir/$expanded_into"
fi
else
lib_dir="$ARTY_LIBS_DIR/$lib_name"
fi