#!/bin/bash # KOMPUTAH AI for Mac. # curl -fsSL https://ai.komputah.com/install.sh | bash set -euo pipefail APP="KOMPUTAH AI.app" bold() { printf "\033[1m%s\033[0m\n" "$1"; } green() { printf "\033[32m%s\033[0m\n" "$1"; } if [ "$(uname -s)" != "Darwin" ]; then echo "This installer is for Mac." echo "On Windows, open PowerShell and run: irm https://ai.komputah.com/install.ps1 | iex" exit 1 fi bold "KOMPUTAH AI" echo "Downloading for Mac…" TMP="$(mktemp -d)" trap 'rm -rf "$TMP"' EXIT BASE="${KOMPUTAH_BASE:-https://ai.komputah.com}" curl -fL --progress-bar "${BASE%/}/downloads/KOMPUTAH-AI-mac.tar.gz" -o "$TMP/app.tar.gz" if ! tar -xzf "$TMP/app.tar.gz" -C "$TMP" 2>/dev/null || [ ! -d "$TMP/$APP" ]; then echo "The download is not ready yet. Please try again in a few minutes." exit 1 fi DEST="/Applications" [ -w "$DEST" ] || DEST="$HOME/Applications" mkdir -p "$DEST" rm -rf "$DEST/$APP" mv "$TMP/$APP" "$DEST/" xattr -dr com.apple.quarantine "$DEST/$APP" 2>/dev/null || true green "✓ KOMPUTAH AI is installed in $DEST" echo "Opening it now. Next time, find it in Launchpad or Spotlight." open "$DEST/$APP"