#!/bin/bash set -e # Copy .env file cp $CONDUCTOR_ROOT_PATH/.env .env # Setup shared dependencies via symlinks to main repo echo "Setting up shared node_modules and vendor directories..." # Ensure main repo has the directories mkdir -p "$CONDUCTOR_ROOT_PATH/node_modules" mkdir -p "$CONDUCTOR_ROOT_PATH/vendor" # 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 # 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 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"