diff --git a/install.sh b/install.sh index 683580b..55ced3a 100755 --- a/install.sh +++ b/install.sh @@ -105,6 +105,42 @@ echo " ║ ReceiptNext Installer ║" echo " ╚═══════════════════════════════════════╝" echo "" +# ── Install dependencies ─────────────────────────────────────────── +if ! command -v git &>/dev/null; then + info "Installing git..." + if command -v apt-get &>/dev/null; then + sudo_if apt-get update -qq && sudo_if apt-get install -y -qq git 2>&1 | tail -1 + elif command -v dnf &>/dev/null; then + sudo_if dnf install -y git 2>&1 | tail -1 + elif command -v apk &>/dev/null; then + sudo_if apk add git 2>&1 | tail -1 + else + err "Please install git manually, then re-run install.sh" + exit 1 + fi +fi +if ! command -v curl &>/dev/null; then + info "Installing curl..." + if command -v apt-get &>/dev/null; then + sudo_if apt-get install -y -qq curl 2>&1 | tail -1 + elif command -v dnf &>/dev/null; then + sudo_if dnf install -y curl 2>&1 | tail -1 + elif command -v apk &>/dev/null; then + sudo_if apk add curl 2>&1 | tail -1 + fi +fi +# python3 is used for parsing release JSON +if ! command -v python3 &>/dev/null; then + info "Installing python3..." + if command -v apt-get &>/dev/null; then + sudo_if apt-get install -y -qq python3 2>&1 | tail -1 + elif command -v dnf &>/dev/null; then + sudo_if dnf install -y python3 2>&1 | tail -1 + elif command -v apk &>/dev/null; then + sudo_if apk add python3 2>&1 | tail -1 + fi +fi + # ── 1. Clone repo ──────────────────────────────────────────────── if [ -d "$INSTALL_DIR" ]; then warn "$INSTALL_DIR already exists — pulling latest..."