chore: fix install script (revert) (#3514)
This commit is contained in:
parent
52e2f9338e
commit
9a8a056e9f
9
install.sh
Executable file → Normal file
9
install.sh
Executable file → Normal file
@ -317,14 +317,11 @@ http_copy() {
|
|||||||
github_release() {
|
github_release() {
|
||||||
owner_repo=$1
|
owner_repo=$1
|
||||||
version=$2
|
version=$2
|
||||||
if [ -z "$version" ] || [ "$version" = "latest" ]; then
|
test -z "$version" && version="latest"
|
||||||
giturl="https://api.github.com/repos/${owner_repo}/releases/latest"
|
giturl="https://github.com/${owner_repo}/releases/${version}"
|
||||||
else
|
|
||||||
giturl="https://api.github.com/repos/${owner_repo}/releases/tags/${version}"
|
|
||||||
fi
|
|
||||||
json=$(http_copy "$giturl" "Accept:application/json")
|
json=$(http_copy "$giturl" "Accept:application/json")
|
||||||
test -z "$json" && return 1
|
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
|
test -z "$version" && return 1
|
||||||
echo "$version"
|
echo "$version"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user