Fix github release url (#916)

This commit is contained in:
张祖建 2023-01-30 16:32:09 +08:00 committed by GitHub
parent 7dcb8c7436
commit e85e1a7234
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -281,10 +281,10 @@ github_release() {
owner_repo=$1
version=$2
test -z "$version" && version="latest"
giturl="https://github.com/${owner_repo}/releases/${version}"
giturl="https://api.github.com/repos/${owner_repo}/releases/tags/${version}"
json=$(http_copy "$giturl" "Accept:application/json")
test -z "$json" && return 1
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name":"//' | sed 's/".*//')
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name": *"//' | sed 's/".*//')
test -z "$version" && return 1
echo "$version"
}