Use absolute paths in rm commands for safety

Changed rm -rf commands to use absolute paths ($WORKTREE_PATH) instead
of relative paths to prevent accidental deletion if symlinks behave
unexpectedly.

Also cleaned up duplicate WORKTREE_PATH definition.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai 2025-11-14 13:15:03 +01:00
parent b847e3801a
commit 4507d99460

View file

@ -11,12 +11,14 @@ echo "Setting up shared node_modules and vendor directories..."
mkdir -p "$CONDUCTOR_ROOT_PATH/node_modules"
mkdir -p "$CONDUCTOR_ROOT_PATH/vendor"
# Get current worktree path
WORKTREE_PATH=$(pwd)
# Remove existing directories if they exist and are not symlinks
[ -d "node_modules" ] && [ ! -L "node_modules" ] && rm -rf node_modules
[ -d "vendor" ] && [ ! -L "vendor" ] && rm -rf vendor
[ -d "node_modules" ] && [ ! -L "node_modules" ] && rm -rf "$WORKTREE_PATH/node_modules"
[ -d "vendor" ] && [ ! -L "vendor" ] && rm -rf "$WORKTREE_PATH/vendor"
# Calculate relative path from worktree to main repo
WORKTREE_PATH=$(pwd)
RELATIVE_PATH=$(python3 -c "import os.path; print(os.path.relpath('$CONDUCTOR_ROOT_PATH', '$WORKTREE_PATH'))")
# Create symlinks to main repo's node_modules and vendor