Fix grep error in alpine linux

This commit is contained in:
Jeevitha Kannan K S 2024-12-10 19:26:39 +05:30 committed by GitHub
parent 987f5da3b9
commit a10c1edb8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,8 +8,9 @@ RED='\033[0;31m'
# Function to fetch the latest release tag from the GitHub API # Function to fetch the latest release tag from the GitHub API
get_latest_release() { get_latest_release() {
latest_release=$(curl -s https://api.github.com/repos/ChrisTitusTech/linutil/releases | latest_release=$(curl -s https://api.github.com/repos/ChrisTitusTech/linutil/releases |
grep -oP '"tag_name": "\K[^"]*' | grep "tag_name" |
head -n 1) head -n 1 |
sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
if [ -z "$latest_release" ]; then if [ -z "$latest_release" ]; then
printf "%b\n" "Error fetching release data" >&2 printf "%b\n" "Error fetching release data" >&2
return 1 return 1