mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-08-14 00:47:51 +00:00
fix: install script skips empty releases, finds latest with binary assets
This commit is contained in:
+12
-2
@@ -46,13 +46,23 @@ install() {
|
||||
echo " =================="
|
||||
echo ""
|
||||
|
||||
# Get latest version
|
||||
# Get latest version with binary assets
|
||||
if [ -n "${OPENFANG_VERSION:-}" ]; then
|
||||
VERSION="$OPENFANG_VERSION"
|
||||
echo " Using specified version: $VERSION"
|
||||
else
|
||||
echo " Fetching latest release..."
|
||||
VERSION=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"//' | sed 's/".*//')
|
||||
# Find the most recent release that has binary assets (skip empty tag-only releases)
|
||||
VERSION=$(curl -fsSL "https://api.github.com/repos/$REPO/releases?per_page=10" | \
|
||||
grep -E '"tag_name"|"assets":\[' | \
|
||||
paste - - | \
|
||||
grep -v '"assets":\[\]' | \
|
||||
head -1 | \
|
||||
sed 's/.*"tag_name": *"//' | sed 's/".*//')
|
||||
# Fallback to /releases/latest if the above fails
|
||||
if [ -z "$VERSION" ]; then
|
||||
VERSION=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"//' | sed 's/".*//')
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
|
||||
Reference in New Issue
Block a user