Skip to content

Commit

Permalink
Fix github latest URL (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-omotani authored Jan 30, 2023
1 parent e85e1a7 commit 9432e67
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ http_copy() {
github_release() {
owner_repo=$1
version=$2
test -z "$version" && version="latest"
giturl="https://api.github.com/repos/${owner_repo}/releases/tags/${version}"
if [ -z "${version}" ]; then
giturl="https://api.github.com/repos/${owner_repo}/releases/latest"
fi
json=$(http_copy "$giturl" "Accept:application/json")
test -z "$json" && return 1
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name": *"//' | sed 's/".*//')
Expand Down

0 comments on commit 9432e67

Please sign in to comment.