#!/bin/bash # # Setup script for marcus-web blog scripts # Run this once after cloning the repo on a new machine # set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" echo "Setting up marcus-web scripts..." echo "Project root: $PROJECT_ROOT" # Check for Python 3 if ! command -v python3 &> /dev/null; then echo "ERROR: python3 not found. Please install Python 3." exit 1 fi # Create virtual environment if it doesn't exist VENV_DIR="$PROJECT_ROOT/.venv" if [ ! -d "$VENV_DIR" ]; then echo "Creating virtual environment..." python3 -m venv "$VENV_DIR" fi # Activate and install dependencies echo "Installing dependencies..." source "$VENV_DIR/bin/activate" pip install --quiet --upgrade pip pip install --quiet -r "$PROJECT_ROOT/requirements.txt" echo "" echo "Done! To use the scripts, either:" echo "" echo " 1. Activate the venv first:" echo " source .venv/bin/activate" echo " python scripts/import_letterboxd.py" echo "" echo " 2. Or run directly with the venv python:" echo " .venv/bin/python scripts/import_letterboxd.py" echo ""