added more binaries
This commit is contained in:
parent
d71714ff11
commit
a18f593d57
14
install.sh
14
install.sh
|
@ -5,7 +5,7 @@ BINARY_NAME="haste-it"
|
|||
BASE_URL="https://git.nixc.us/Nixius/haste-it/raw/branch/main/dist"
|
||||
|
||||
declare -A binaries
|
||||
binaries["linux/amd64"]="haste-it_linux_amd64"
|
||||
binaries["linux/amd64"]="haste-it"
|
||||
binaries["linux/arm64"]="haste-it_linux_arm64"
|
||||
binaries["linux/arm/v7"]="haste-it_linux_arm"
|
||||
binaries["darwin/amd64"]="haste-it_darwin_amd64"
|
||||
|
@ -18,6 +18,7 @@ case $ARCH in
|
|||
x86_64) ARCH="amd64" ;;
|
||||
arm64 | aarch64) ARCH="arm64" ;;
|
||||
arm*) ARCH="arm/v7" ;;
|
||||
*) echo "Unsupported architecture: $ARCH"; exit 1 ;;
|
||||
esac
|
||||
|
||||
KEY="${OS}/${ARCH}"
|
||||
|
@ -32,12 +33,5 @@ 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}"
|
||||
|
||||
# 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. The downloaded file is too small or invalid."
|
||||
sudo rm -f "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
exit 1
|
||||
fi
|
||||
sudo chmod +x "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
echo "Installed $BINARY_NAME to $INSTALL_DIR"
|
||||
|
|
Loading…
Reference in New Issue