Skip to content

Commit c3b8496

Browse files
authored
Merge pull request #523 from FelipeEstevanatto/main
add wget fallback in installation
2 parents 498c1a3 + af09ce8 commit c3b8496

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

install.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,17 @@ do_install () {
4040

4141
echo "Downloading latest binary (kool-$PLAT-$ARCH)..."
4242

43-
# TODO: fallback to wget if no curl available
44-
rm -f /tmp/kool_binary
45-
curl -fsSL "$DOWNLOAD_URL/kool-$PLAT-$ARCH" -o /tmp/kool_binary
43+
rm -f /tmp/kool_binary
44+
45+
# fallback to wget if no curl available
46+
if command -v curl &> /dev/null; then
47+
curl -fsSL "$DOWNLOAD_URL/kool-$PLAT-$ARCH" -o /tmp/kool_binary
48+
elif command -v wget &> /dev/null; then
49+
wget -qO /tmp/kool_binary "$DOWNLOAD_URL/kool-$PLAT-$ARCH"
50+
else
51+
echo -e "\033[31;31mError: Neither curl nor wget is available. Please install one of them to proceed.\033[0m"
52+
exit 1
53+
fi
4654

4755
# check for running kool process which would prevent
4856
# replacing existing version under Linux.

0 commit comments

Comments
 (0)