mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2026-09-10 07:36:38 -04:00
fix: gh-r retrieves release data GH REST API (#373)
Recent changes to GitHub HTML structure broke `gh-r` & `bpick` ices method of parsing project release assets. - `gh-r` utilizes official GitHub REST API to retrieve project releases data - add `local` scope to `releases_url` variable # closes #374 Co-authored-by: Tyler Wardhaugh <tyler.wardhaugh@gmail.com>
This commit is contained in:
parent
8ed4e96dea
commit
4a2a120b34
|
|
@ -354,7 +354,13 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
|
|||
|
||||
(
|
||||
if [[ $site = */releases ]] {
|
||||
local url=$site/${ICE[ver]}
|
||||
local tag_version=${ICE[ver]}
|
||||
if [[ -z $tag_version ]]; then
|
||||
tag_version="$( { .zinit-download-file-stdout $site/latest || .zinit-download-file-stdout $site/latest 1; } 2>/dev/null | \
|
||||
command grep -m1 -o 'href=./'$user'/'$plugin'/releases/tag/[^"]\+')"
|
||||
tag_version=${tag_version##*/}
|
||||
fi
|
||||
local url=$site/expanded_assets/$tag_version
|
||||
|
||||
.zinit-get-latest-gh-r-url-part "$user" "$plugin" "$url" || return $?
|
||||
|
||||
|
|
@ -1456,7 +1462,14 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
|
|||
local user=$1 plugin=$2 urlpart=$3
|
||||
|
||||
if [[ -z $urlpart ]] {
|
||||
local url=https://github.com/$user/$plugin/releases/$ICE[ver]
|
||||
local tag_version=${ICE[ver]}
|
||||
if [[ -z $tag_version ]]; then
|
||||
local releases_url=https://github.com/$user/$plugin/releases/latest
|
||||
tag_version="$( { .zinit-download-file-stdout $releases_url || .zinit-download-file-stdout $releases_url 1; } 2>/dev/null | \
|
||||
command grep -m1 -o 'href=./'$user'/'$plugin'/releases/tag/[^"]\+')"
|
||||
tag_version=${tag_version##*/}
|
||||
fi
|
||||
local url=https://github.com/$user/$plugin/releases/expanded_assets/$tag_version
|
||||
} else {
|
||||
local url=https://$urlpart
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue