#!/bin/bash # Vessel Auto-activating Runner Script # Resolve directory of this script DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$DIR" # Automatically activate virtual environment if it exists if [ -d ".venv" ]; then source .venv/bin/activate else echo "⚠️ Warning: Local python virtual environment (.venv) not found." echo "Please run: python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt" fi # Determine script target (default to app.py) TARGET="${1:-app.py}" if [ "$TARGET" == "verify" ]; then python3 verify_code.py "${@:2}" elif [ "$TARGET" == "db" ]; then python3 -c "import database; database.initialize_database()" "${@:2}" elif [ -f "$TARGET" ]; then python3 "$TARGET" "${@:2}" else echo "❌ Error: Target script '$TARGET' not found." echo "Usage:" echo " ./run.sh # Launch the main Gradio application" echo " ./run.sh verify # Run code format, lint, and type checks" echo " ./run.sh db # Initialize/seed SQLite database" fi