fix: install.sh installs git, curl, python3 if missing
- 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)
This commit is contained in:
parent
92f070440f
commit
e49b184be8
1 changed files with 36 additions and 0 deletions
36
install.sh
36
install.sh
|
|
@ -105,6 +105,42 @@ echo " ║ ReceiptNext Installer ║"
|
||||||
echo " ╚═══════════════════════════════════════╝"
|
echo " ╚═══════════════════════════════════════╝"
|
||||||
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 ────────────────────────────────────────────────
|
# ── 1. Clone repo ────────────────────────────────────────────────
|
||||||
if [ -d "$INSTALL_DIR" ]; then
|
if [ -d "$INSTALL_DIR" ]; then
|
||||||
warn "$INSTALL_DIR already exists — pulling latest..."
|
warn "$INSTALL_DIR already exists — pulling latest..."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue