#!/bin/bash set -e # Ghetto Blaster installer script REPO="xlgmokha/ghetto-blaster" BINARY_NAME="ghetto-blaster" # Detect OS and architecture OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) case $OS in linux) case $ARCH in x86_64) TARGET="linux-x86_64" ;; *) echo "Unsupported architecture: $ARCH"; exit 1 ;; esac ;; darwin) case $ARCH in x86_64) TARGET="macos-x86_64" ;; arm64) TARGET="macos-arm64" ;; *) echo "Unsupported architecture: $ARCH"; exit 1 ;; esac ;; *) echo "Unsupported OS: $OS (Linux and macOS only)" exit 1 ;; esac echo "🎵 Installing Ghetto Blaster for $OS ($ARCH)..." # Get latest release LATEST_RELEASE=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') DOWNLOAD_URL="https://github.com/$REPO/releases/download/$LATEST_RELEASE/$BINARY_NAME-$TARGET.tar.gz" echo "📦 Downloading $LATEST_RELEASE..." curl -L "$DOWNLOAD_URL" -o "/tmp/$BINARY_NAME.tar.gz" echo "📂 Extracting..." cd /tmp tar -xzf "$BINARY_NAME.tar.gz" echo "🔧 Installing to /usr/local/bin..." sudo mv "$BINARY_NAME" /usr/local/bin/ sudo chmod +x "/usr/local/bin/$BINARY_NAME" echo "✅ Installation complete!" echo "" echo "🎧 Run with: ghetto-blaster" echo "📖 Config: ~/.config/ghetto-blaster.yml" echo "" echo "🎉 Enjoy your music!"