From 9432e676a83759e8a78788ca3265cad19bbf8192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=27o=20mo=29y-=CB=9C?= Date: Mon, 30 Jan 2023 19:30:08 +0900 Subject: [PATCH] Fix github latest URL (#918) --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5abf9bc..2b6403c 100644 --- a/install.sh +++ b/install.sh @@ -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/".*//')