Skip to content

Commit

Permalink
chore: fix install script (revert) (#3514)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jan 28, 2023
1 parent 52e2f93 commit 9a8a056
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions install.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,11 @@ http_copy() {
github_release() {
owner_repo=$1
version=$2
if [ -z "$version" ] || [ "$version" = "latest" ]; then
giturl="https://api.github.com/repos/${owner_repo}/releases/latest"
else
giturl="https://api.github.com/repos/${owner_repo}/releases/tags/${version}"
fi
test -z "$version" && version="latest"
giturl="https://github.com/${owner_repo}/releases/${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"
}
Expand Down

0 comments on commit 9a8a056

Please sign in to comment.