#!/bin/bash # Upload a video file to Cloudflare R2 # Usage: ./upload.sh /path/to/video.mp4 [optional-object-name] # Get the directory where this script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PROJECT_DIR="$(dirname "$SCRIPT_DIR")" # Change to project directory to ensure .env is found cd "$PROJECT_DIR" # Use venv if it exists, otherwise use system python if [ -d "venv" ]; then PYTHON="venv/bin/python" else PYTHON="python3" fi # Run the upload script $PYTHON -m obs_uploader.upload "$@"