#!/usr/bin/env bash # # Clone Dolphin Emulator source repository # # dolphin-tool: Command-line tool for RVZ compression (part of Dolphin) # Repository: https://github.com/dolphin-emu/dolphin # Purpose: Best compression for Wii/GameCube ISOs (60-70% savings) # set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SRC_DIR="${SCRIPT_DIR}/src" REPO_URL="https://github.com/dolphin-emu/dolphin.git" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Cloning Dolphin Emulator (for dolphin-tool)" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "Repository: ${REPO_URL}" echo "Destination: ${SRC_DIR}" echo "" echo "⚠️ Note: This is a large repository (~500MB)" echo " We'll do a shallow clone to speed things up" echo "" # Remove existing source if present if [ -d "${SRC_DIR}" ]; then echo "⚠️ Removing existing source directory..." rm -rf "${SRC_DIR}" fi # Clone the repository (shallow to save time/space) echo "📦 Cloning repository (shallow clone)..." git clone --depth 1 --branch master "${REPO_URL}" "${SRC_DIR}" cd "${SRC_DIR}" echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "✅ Clone complete!" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" # Show version info echo "📋 Repository Information:" echo " Latest commit: $(git rev-parse --short HEAD)" echo " Commit date: $(git log -1 --format=%cd --date=short)" echo " Commit message: $(git log -1 --format=%s)" echo "" # Check for available tags/releases if git tag -l | grep -q .; then echo " Note: Shallow clone - use full clone to see all releases" fi # Save version info VERSION_FILE="${SCRIPT_DIR}/VERSION.txt" { echo "Dolphin Emulator (dolphin-tool) version information" echo "===================================================" echo "" echo "Repository: ${REPO_URL}" echo "Branch: master" echo "Commit: $(git rev-parse HEAD)" echo "Short commit: $(git rev-parse --short HEAD)" echo "Date: $(git log -1 --format=%cd --date=iso)" echo "Message: $(git log -1 --format=%s)" echo "" echo "Clone type: shallow (--depth 1)" echo "Clone date: $(date -u +%Y%m%d%H%M)" } > "${VERSION_FILE}" echo "📄 Version info saved to: ${VERSION_FILE}" echo ""