File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -317,14 +317,11 @@ http_copy() {
317
317
github_release () {
318
318
owner_repo=$1
319
319
version=$2
320
- if [ -z " $version " ] || [ " $version " = " latest" ]; then
321
- giturl=" https://api.github.com/repos/${owner_repo} /releases/latest"
322
- else
323
- giturl=" https://api.github.com/repos/${owner_repo} /releases/tags/${version} "
324
- fi
320
+ test -z " $version " && version=" latest"
321
+ giturl=" https://github.com/${owner_repo} /releases/${version} "
325
322
json=$( http_copy " $giturl " " Accept:application/json" )
326
323
test -z " $json " && return 1
327
- version=$( echo " $json " | tr -s ' \n' ' ' | sed ' s/.*"tag_name": "//' | sed ' s/".*//' )
324
+ version=$( echo " $json " | tr -s ' \n' ' ' | sed ' s/.*"tag_name":"//' | sed ' s/".*//' )
328
325
test -z " $version " && return 1
329
326
echo " $version "
330
327
}
You can’t perform that action at this time.
0 commit comments