#!/bin/bash # Wrapper script for Supabase CLI that automatically sets HOST_SITE_URL # Usage: ./scripts/supabase-with-env.sh [args...] # Get the script directory SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" # Source the environment setup script source "$SCRIPT_DIR/set-host-env.sh" # Change to project root (Supabase CLI looks for supabase/ directory) cd "$PROJECT_ROOT" || exit 1 # Check if supabase command exists if ! command -v supabase >/dev/null 2>&1; then echo "Error: Supabase CLI is not installed or not in PATH" >&2 echo "Install it from: https://supabase.com/docs/guides/cli" >&2 exit 1 fi # Run the supabase command with all arguments exec supabase "$@"