Simplify latest version install script

This commit is contained in:
f-trycua
2025-03-17 15:20:47 +01:00
parent 18f85e3269
commit 44914f1180

View File

@@ -62,26 +62,10 @@ create_temp_dir() {
# Download the latest release
download_release() {
echo "Fetching latest release information..."
# Try to get the latest version from GitHub API
if command -v curl &> /dev/null; then
RELEASE_INFO=$(curl -s "$LATEST_RELEASE_URL")
VERSION=$(echo "$RELEASE_INFO" | grep -o '"tag_name": "v[^"]*"' | cut -d'"' -f4 | sed 's/^v//')
if [ -z "$VERSION" ]; then
echo "${RED}Failed to get latest version.${NORMAL} Using direct download link."
# Try simpler URL with the non-versioned symlink
DOWNLOAD_URL="https://github.com/$GITHUB_REPO/releases/latest/download/lume.tar.gz"
else
echo "Latest version: ${BOLD}$VERSION${NORMAL}"
DOWNLOAD_URL="https://github.com/$GITHUB_REPO/releases/download/v$VERSION/lume.tar.gz"
fi
else
echo "${RED}curl not found.${NORMAL} Using direct download link."
DOWNLOAD_URL="https://github.com/$GITHUB_REPO/releases/latest/download/lume.tar.gz"
fi
echo "Downloading latest Lume release..."
# Use the direct download link with the non-versioned symlink
DOWNLOAD_URL="https://github.com/$GITHUB_REPO/releases/latest/download/lume.tar.gz"
echo "Downloading from: $DOWNLOAD_URL"
# Download the tarball