From af09ce84fa78b07a4dc65d79568091873bf88bae Mon Sep 17 00:00:00 2001 From: FelipeEstevanatto Date: Thu, 8 May 2025 19:41:01 -0300 Subject: [PATCH] add wget fallback in installation --- install.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 41102d63..68333aaf 100644 --- a/install.sh +++ b/install.sh @@ -40,9 +40,17 @@ do_install () { echo "Downloading latest binary (kool-$PLAT-$ARCH)..." - # TODO: fallback to wget if no curl available - rm -f /tmp/kool_binary - curl -fsSL "$DOWNLOAD_URL/kool-$PLAT-$ARCH" -o /tmp/kool_binary + rm -f /tmp/kool_binary + + # fallback to wget if no curl available + if command -v curl &> /dev/null; then + curl -fsSL "$DOWNLOAD_URL/kool-$PLAT-$ARCH" -o /tmp/kool_binary + elif command -v wget &> /dev/null; then + wget -qO /tmp/kool_binary "$DOWNLOAD_URL/kool-$PLAT-$ARCH" + else + echo -e "\033[31;31mError: Neither curl nor wget is available. Please install one of them to proceed.\033[0m" + exit 1 + fi # check for running kool process which would prevent # replacing existing version under Linux.