git version check

This commit is contained in:
shocknet-justin 2025-08-27 13:03:53 -04:00
parent 0754c1bcc8
commit 43323dacbf

View file

@ -44,7 +44,8 @@ install_lightning_pub() {
log_error "GitHub API rate limit exceeded. Please wait a while before trying again." 1 log_error "GitHub API rate limit exceeded. Please wait a while before trying again." 1
fi fi
LATEST_COMMIT=$(echo "$API_RESPONSE" | grep -o '"sha":"[^"]*"' | cut -d'"' -f4 | head -c 40) # Safely parse the JSON by finding the first "html_url" that contains "/commit/" and extracting the hash from it.
LATEST_COMMIT=$(echo "$API_RESPONSE" | grep '"html_url":.*commit/' | head -n 1 | sed -n 's|.*commit/\([0-9a-f]\{40\}\).*|\1|p')
# If we still couldn't get the commit, it's a different network or API error. # If we still couldn't get the commit, it's a different network or API error.
if [ -z "$LATEST_COMMIT" ]; then if [ -z "$LATEST_COMMIT" ]; then