fix: setup.sh installs curl + git + go for all package managers
This commit is contained in:
parent
0e781b157e
commit
e62efa5534
1 changed files with 16 additions and 8 deletions
24
setup.sh
24
setup.sh
|
|
@ -27,14 +27,22 @@ trap cleanup EXIT
|
||||||
echo -e "${BOLD}Wallarm Bootstrap${NC}"
|
echo -e "${BOLD}Wallarm Bootstrap${NC}"
|
||||||
|
|
||||||
# ── Prerequisites ─────────────────────────────────────────────────────
|
# ── Prerequisites ─────────────────────────────────────────────────────
|
||||||
if ! command -v git >/dev/null 2>&1; then
|
install_deps() {
|
||||||
apt-get update -qq 2>/dev/null && apt-get install -y -qq git 2>/dev/null || true
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
fi
|
apt-get update -qq
|
||||||
if ! command -v go >/dev/null 2>&1; then
|
apt-get install -y -qq curl git golang-go 2>/dev/null
|
||||||
echo -e "${YELLOW}Installing Go...${NC}"
|
elif command -v yum >/dev/null 2>&1; then
|
||||||
apt-get update -qq 2>/dev/null && apt-get install -y -qq golang-go 2>/dev/null || {
|
yum install -y -q curl git golang 2>/dev/null
|
||||||
echo -e "${RED}Install Go 1.21+ manually.${NC}"; exit 1
|
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
|
fi
|
||||||
echo -e "${GREEN}git $(git --version | cut -d' ' -f3) go $(go version | cut -d' ' -f3)${NC}"
|
echo -e "${GREEN}git $(git --version | cut -d' ' -f3) go $(go version | cut -d' ' -f3)${NC}"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue