Update install.sh
This commit is contained in:
parent
7d26a3d6a5
commit
594a6c271b
|
@ -31,10 +31,13 @@ BINARY_URL="${BASE_URL}/${binaries[$KEY]}"
|
|||
|
||||
echo "Downloading and installing $BINARY_NAME from $BINARY_URL..."
|
||||
sudo curl -sSL "$BINARY_URL" -o "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
|
||||
# Verify the downloaded file is not an error message or too small
|
||||
if [[ -f "${INSTALL_DIR}/${BINARY_NAME}" && $(wc -c <"${INSTALL_DIR}/${BINARY_NAME}") -gt 1000 ]]; then
|
||||
sudo chmod +x "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
echo "Installed $BINARY_NAME to $INSTALL_DIR"
|
||||
else
|
||||
echo "Failed to download or install $BINARY_NAME."
|
||||
echo "Failed to download or install $BINARY_NAME. The downloaded file is too small or invalid."
|
||||
sudo rm -f "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue