summaryrefslogtreecommitdiff
path: root/scripts/install.sh
blob: c7349125cf6e845fb081c85ea12167413ff826f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/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!"