@@ -1544,47 +1544,46 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
1544
1544
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/[^"]\+' )"
1545
1545
tag_version=${tag_version##*/}
1546
1546
fi
1547
- local url=https://github.com/$user/$plugin/releases/expanded_assets/$tag_version else
1547
+ local url=https://github.com/$user/$plugin/releases/expanded_assets/$tag_version
1548
+ else
1548
1549
local url=https://$urlpart
1549
1550
fi
1550
1551
init_list=( ${(@f)"$( { .zinit-download-file-stdout $url || .zinit-download-file-stdout $url 1; } 2>/dev/null | command grep -o 'href=./'$user'/'$plugin'/releases/download/[^"]\+')"} )
1551
1552
init_list=(${init_list[@]#href=?})
1552
1553
bpicks=(${(s.;.)ICE[bpick]})
1553
1554
[[ -z $bpicks ]] && bpicks=("")
1554
- local bpick bpick_error
1555
+ local bpick bpick_error=""
1555
1556
reply=()
1556
1557
for bpick in "${bpicks[@]}"; do
1557
1558
list=($init_list)
1558
- if [[ -n $bpick ]] {
1559
+ if [[ -n $bpick ]]; then
1559
1560
list=( ${(M)list[@]:#(#i)*/$~bpick} )
1560
- bpick_error="{nl}{info}[{pre}gh-r{info}]{rst} To fix, modify {ice}bpick{rst} ice value {glob}${bpick}"
1561
- }
1561
+ if (( !$#list )); then
1562
+ +zinit-message "{info}[{pre}gh-r{info}] {error}Error{rst}: {ice}bpick{rst} ice found no release assets{rst}. To fix, modify the {ice}bpick{rst} glob pattern {glob}${bpick}{rst}"
1563
+ fi
1564
+ fi
1562
1565
1563
1566
local junk="([3-6]86|md5|sig|asc|txt|vsix|sum|sha256*|pkg|.(apk|deb|json|rpm|sh(#e)))"
1564
1567
filtered=( ${list[@]:#(#i)*${~junk}*} ) && (( $#filtered > 0 )) && list=( ${filtered[@]} )
1565
1568
1566
1569
for part in "${parts[@]}"; do
1567
- if (( $#list > 1 )) {
1568
- filtered=( ${(M)list[@]:#(#i)*${~part}*} ) && (( $#filtered > 0 )) && list=( ${filtered[@]} )
1569
- # +zinit-message "{info}[{pre}gh-r{info}]{rst} filter -> {glob}${part}{rst}{nl} - ${(@pj:\n - :)list[1,2]}{nl}"
1570
- }
1570
+ if (( $#list > 1 )) { filtered=( ${(M)list[@]:#(#i)*${~part}*} ) && (( $#filtered > 0 )) && list=( ${filtered[@]} ) }
1571
+ # +zinit-message "{info}[{pre}gh-r{info}]{rst} filter -> {glob}${part}{rst}{nl} - ${(@pj:\n - :)list[1,2]}{nl}"
1571
1572
done
1572
1573
1573
- if (( $#list > 1 )); then
1574
- filtered=( ${list[@]:#(#i)*.(sha[[:digit:]]#|asc)} ) && (( $#filtered > 0 )) && list=( ${filtered[@]} )
1575
- fi
1574
+ if (( $#list > 1 )) { filtered=( ${list[@]:#(#i)*.(sha[[:digit:]]#|asc)} ) && (( $#filtered > 0 )) && list=( ${filtered[@]} ); }
1576
1575
1577
1576
if (( !$#list )); then
1578
- +zinit-message -n "{ info}[{pre}gh-r{info}]{error} No GitHub release asset to download ${bpick_error }{rst}"
1577
+ +zinit-message "{nl}{ info}[{pre}gh-r{info}] {error}Error{rst}: No GitHub release assets found for {glob}${tag_version }{rst}"
1579
1578
return 1
1580
1579
fi
1581
- reply+=($ list[1])
1580
+ reply+=( "${ list[1]}" )
1582
1581
done
1583
1582
[[ -n $reply ]]
1584
1583
} # ]]]
1585
1584
# FUNCTION: ziextract [[[
1586
1585
# If the file is an archive, it is extracted by this function.
1587
- # Next stage is scanning of files with the common utility ` file',
1586
+ # Next stage is scanning of files with the common utility file
1588
1587
# to detect executables. They are given +x mode. There are also
1589
1588
# messages to the user on performed actions.
1590
1589
#
0 commit comments