From e62efa55349ed305a39e8db4d57818600caeda0c Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 3 Aug 2026 10:38:36 +0000 Subject: [PATCH] fix: setup.sh installs curl + git + go for all package managers --- setup.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index e1d7318..8450835 100644 --- a/setup.sh +++ b/setup.sh @@ -27,14 +27,22 @@ trap cleanup EXIT echo -e "${BOLD}Wallarm Bootstrap${NC}" # ── Prerequisites ───────────────────────────────────────────────────── -if ! command -v git >/dev/null 2>&1; then - apt-get update -qq 2>/dev/null && apt-get install -y -qq git 2>/dev/null || true -fi -if ! command -v go >/dev/null 2>&1; then - echo -e "${YELLOW}Installing Go...${NC}" - apt-get update -qq 2>/dev/null && apt-get install -y -qq golang-go 2>/dev/null || { - echo -e "${RED}Install Go 1.21+ manually.${NC}"; exit 1 - } +install_deps() { + if command -v apt-get >/dev/null 2>&1; then + apt-get update -qq + apt-get install -y -qq curl git golang-go 2>/dev/null + elif command -v yum >/dev/null 2>&1; then + yum install -y -q curl git golang 2>/dev/null + elif command -v dnf >/dev/null 2>&1; then + dnf install -y -q curl git golang 2>/dev/null + elif command -v apk >/dev/null 2>&1; then + apk add --no-cache curl git go 2>/dev/null + fi +} + +if ! command -v curl >/dev/null 2>&1 || ! command -v git >/dev/null 2>&1 || ! command -v go >/dev/null 2>&1; then + echo -e "${YELLOW}Installing dependencies...${NC}" + install_deps fi echo -e "${GREEN}git $(git --version | cut -d' ' -f3) go $(go version | cut -d' ' -f3)${NC}"