#!/usr/bin/env bash # # Clone wud-compress source repository # # wud-compress: Wii U disc image compression tool # Repository: https://github.com/Exzap/wud-compress # Purpose: Compress WUD (Wii U Disc) files to WUX format # set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SRC_DIR="${SCRIPT_DIR}/src" REPO_URL="https://github.com/cemu-project/WudCompress.git" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Cloning wud-compress" 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 "" fi # Save version info VERSION_FILE="${SCRIPT_DIR}/VERSION.txt" { echo "wud-compress 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')" fi echo "" echo "Clone date: $(date -u +%Y%m%d%H%M)" } > "${VERSION_FILE}" echo "📄 Version info saved to: ${VERSION_FILE}" echo ""