This commit is contained in:
pika 2025-05-04 20:47:33 +02:00
parent 3ec76a796e
commit f218cf6450

View file

@ -25,7 +25,23 @@ generic() {
echo "🔍 Checking latest release of $REPO..."
latest_release=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
latest_version=${latest_release#v} # Remove 'v' prefix (e.g., v0.42.2 → 0.42.2)
download_url="https://github.com/$REPO/releases/download/$latest_release/$BINARY_NAME-x86_64-unknown-linux-musl.tar.gz"
# Detect system architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64)
ARCH="x86_64"
;;
aarch64 | arm64)
ARCH="aarch64"
;;
*)
echo "❌ Unsupported architecture: $ARCH" >&2
exit 1
;;
esac
download_url="https://github.com/$REPO/releases/download/$latest_release/$BINARY_NAME-$ARCH-unknown-linux-musl.tar.gz"
# Skip if already up-to-date
if [[ "$current_version" == "$latest_version" ]]; then
@ -34,7 +50,7 @@ generic() {
fi
# Download and install
echo "⬇️ Downloading $BINARY_NAME $latest_version..."
echo "⬇️ Downloading $BINARY_NAME $latest_version for $ARCH..."
curl -sL "$download_url" | tar -xz -C "$TMP_DIR"
echo "🛠️ Installing to $INSTALL_DIR..."