Skip to content

Commit

Permalink
[DNM]: wip
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster committed May 5, 2022
1 parent 88698a8 commit 9a2d3bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tests/gh-r.zunit
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
$bat --version; assert $state equals 0
}
@test 'bazel' { # a fast, scalable, multi-language and extensible build system
run zinit lbin"!* -> bazel" for @bazelbuild/bazel; assert $state equals 0
run zinit lbin"!bazel* -> bazel" for @bazelbuild/bazel; assert $state equals 0
local bazel="$ZBIN/bazel"; assert "$bazel" is_executable
$bazel --version; assert $state equals 0
}
Expand Down
32 changes: 16 additions & 16 deletions zinit-install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,22 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
} else { list2=( ${list[@]:#(#i)*${~matchstr[android]}*} ) }
(( $#list2 > 0 )) && list=( ${list2[@]} )

# filter .deb packages if dpkg-deb present
if (( $#list > 1 && ${+commands[dpkg-deb]} == 1 )) {
list2=( ${list[@]:#(#i)*(?64)*deb(#e)} )
} else {
list2=( ${list[@]:#*deb(#e)} )
}
(( $#list2 > 0 )) && list=( ${list2[@]} )

# filter .rpm packages if redhat package manager present
if (( $#list > 1 && ${+commands[rpm]} == 1 )) {
list2=( ${list[@]:#(#i)*(?64)*rpm(#e)} )
} else {
list2=( ${list[@]:#*rpm(#e)} )
}
(( $#list2 > 0 )) && list=( ${list2[@]} )

# filter urls by os (e.g., darwin, linux, windows)
if (( $#list > 1 )) {
list2=( ${(M)list[@]:#(#i)*${~matchstr[${OSTYPE//[0-9.]/}]}*} )
Expand Down Expand Up @@ -1512,22 +1528,6 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
(( $#list2 > 0 )) && list=( ${list2[@]} )
}

# filter .deb packages if dpkg-deb present
if (( $#list > 1 && ${+commands[dpkg-deb]} == 1 )) {
list2=( ${(M)list[@]:#(#i)*(?64)*\.deb(#e)} )
} else {
list2=( ${list[@]:#*\.deb(#e)} )
}
(( $#list2 > 0 )) && list=( ${list2[@]} )

# filter .rpm packages if redhat package manager present
if (( $#list > 1 && ${+commands[rpm]} == 1 )) {
list2=( ${(M)list[@]:#(#i)*(?64)*\.rpm(#e)} )
} else {
list2=( ${list[@]:#*rpm(#e)} )
}
(( $#list2 > 0 )) && list=( ${list2[@]} )

if (( !$#list )) {
+zinit-message -n "{pre}gh-r:{error} failed to find the correct GitHub release asset to download"
if [[ -n $bpick ]] {
Expand Down

0 comments on commit 9a2d3bf

Please sign in to comment.