fix: handle absolute paths correctly in environment variable expansion

Fixed issue where absolute paths from environment variables (like $COMFYUI_ROOT=/workspace/ComfyUI) were being treated as relative paths and prepended with the config directory.

Now checks if the expanded path is absolute (starts with /) and uses it as-is, otherwise treats it as relative to the config file directory.

Before: /home/valknar/Projects/runpod//workspace/ComfyUI
After: /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-24 12:06:01 +01:00
parent d235c5241d
commit bf5c150d23

View File

@@ -417,9 +417,15 @@ install_lib() {
return 1
fi
# Custom directory relative to config file directory
local config_dir=$(dirname "$(realpath "${config_file}")")
lib_dir="$config_dir/$expanded_into"
# Check if expanded path is absolute or relative
if [[ "$expanded_into" == /* ]]; then
# Absolute path - use as-is
lib_dir="$expanded_into"
else
# Relative path - make relative to config file directory
local config_dir=$(dirname "$(realpath "${config_file}")")
lib_dir="$config_dir/$expanded_into"
fi
else
# Use global .arty/libs for libraries without custom 'into'
lib_dir="$ARTY_LIBS_DIR/$lib_name"