From e49b184be84bf034f68a593134e9200957e0601c Mon Sep 17 00:00:00 2001 From: cclohmar Date: Sun, 31 May 2026 03:02:01 +0000 Subject: [PATCH] fix: install.sh installs git, curl, python3 if missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Checks for git before clone/pull — installs via apt/dnf/apk - Checks for curl before downloading release binary - Checks for python3 before parsing release JSON - Multi-distro support (apt-get, dnf, apk) --- install.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) 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..."