#!/usr/bin/env bash # # Clone Wiimms ISO Tools source repository # # wit: Wiimm's ISO Tools for Wii and GameCube # Repository: https://github.com/Wiimm/wiimms-iso-tools # Purpose: Convert, compress, and manage Wii/GameCube disc images # set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SRC_DIR="${SCRIPT_DIR}/src" REPO_URL="https://github.com/Wiimm/wiimms-iso-tools.git" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Cloning Wiimms ISO Tools (wit)" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "Repository: ${REPO_URL}" echo "Destination: ${SRC_DIR}" echo "" # Remove existing source if present if [ -d "${SRC_DIR}" ]; then echo "⚠️ Removing existing source directory..." rm -rf "${SRC_DIR}" fi # Clone the repository echo "📦 Cloning repository..." git clone --depth 1 "${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 " Available releases:" git tag -l | tail -10 | sed 's/^/ - /' echo "" LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo 'none') echo " Latest tag: ${LATEST_TAG}" fi # Save version info VERSION_FILE="${SCRIPT_DIR}/VERSION.txt" { echo "Wiimms ISO Tools (wit) version information" echo "==========================================" echo "" echo "Repository: ${REPO_URL}" 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 "" if git tag -l | grep -q .; then echo "Latest tag: $(git describe --tags --abbrev=0 2>/dev/null || echo 'none')" echo "Describe: $(git describe --tags --always 2>/dev/null || echo 'none')" fi echo "" echo "Clone date: $(date -u +%Y%m%d%H%M)" } > "${VERSION_FILE}" echo "📄 Version info saved to: ${VERSION_FILE}" echo ""