2025-11-14 12:04:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# Copy .env file
|
|
|
|
|
cp $CONDUCTOR_ROOT_PATH/.env .env
|
|
|
|
|
|
2025-11-14 12:06:25 +00:00
|
|
|
# Setup shared dependencies via symlinks to main repo
|
2025-11-14 12:04:19 +00:00
|
|
|
echo "Setting up shared node_modules and vendor directories..."
|
|
|
|
|
|
2025-11-14 12:06:25 +00:00
|
|
|
# Ensure main repo has the directories
|
|
|
|
|
mkdir -p "$CONDUCTOR_ROOT_PATH/node_modules"
|
|
|
|
|
mkdir -p "$CONDUCTOR_ROOT_PATH/vendor"
|
2025-11-14 12:04:19 +00:00
|
|
|
|
2025-11-14 12:15:03 +00:00
|
|
|
# Get current worktree path
|
|
|
|
|
WORKTREE_PATH=$(pwd)
|
|
|
|
|
|
2025-11-14 12:04:19 +00:00
|
|
|
# Remove existing directories if they exist and are not symlinks
|
2025-11-14 12:15:03 +00:00
|
|
|
[ -d "node_modules" ] && [ ! -L "node_modules" ] && rm -rf "$WORKTREE_PATH/node_modules"
|
|
|
|
|
[ -d "vendor" ] && [ ! -L "vendor" ] && rm -rf "$WORKTREE_PATH/vendor"
|
2025-11-14 12:04:19 +00:00
|
|
|
|
2025-11-14 12:06:25 +00:00
|
|
|
# Calculate relative path from worktree to main repo
|
|
|
|
|
RELATIVE_PATH=$(python3 -c "import os.path; print(os.path.relpath('$CONDUCTOR_ROOT_PATH', '$WORKTREE_PATH'))")
|
2025-11-14 12:04:19 +00:00
|
|
|
|
2025-11-14 12:06:25 +00:00
|
|
|
# Create symlinks to main repo's node_modules and vendor
|
2025-11-14 12:04:19 +00:00
|
|
|
ln -sf "$RELATIVE_PATH/node_modules" node_modules
|
|
|
|
|
ln -sf "$RELATIVE_PATH/vendor" vendor
|
|
|
|
|
|
|
|
|
|
echo "✓ Shared dependencies linked successfully"
|
|
|
|
|
echo " node_modules -> $RELATIVE_PATH/node_modules"
|
|
|
|
|
echo " vendor -> $RELATIVE_PATH/vendor"
|