File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -317,14 +317,11 @@ http_copy() {
317317github_release () {
318318 owner_repo=$1
319319 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} "
325322 json=$( http_copy " $giturl " " Accept:application/json" )
326323 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/".*//' )
328325 test -z " $version " && return 1
329326 echo " $version "
330327}
You can’t perform that action at this time.
0 commit comments