From 43323dacbfd871dd6008d0d380368cd1c135a814 Mon Sep 17 00:00:00 2001 From: shocknet-justin Date: Wed, 27 Aug 2025 13:03:53 -0400 Subject: [PATCH] git version check --- scripts/install_lightning_pub.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install_lightning_pub.sh b/scripts/install_lightning_pub.sh index eb75b887..35f34c5e 100755 --- a/scripts/install_lightning_pub.sh +++ b/scripts/install_lightning_pub.sh @@ -44,7 +44,8 @@ install_lightning_pub() { log_error "GitHub API rate limit exceeded. Please wait a while before trying again." 1 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 [ -z "$LATEST_COMMIT" ]; then