Skip to content

Commit

Permalink
Merge branch 'main' into refactor/make-ices
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster committed Jan 9, 2024
2 parents 0d8bf36 + e2d477c commit 4c12946
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .zunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ directories:
output: tests/_output
support: tests/_support
tests: tests
fail_fast: false
verbose: false
fail_fast: true
verbose: true
93 changes: 51 additions & 42 deletions tests/gh-r.zunit
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@
[[ $OSTYPE =~ 'linux*' ]] && skip "Alacritty test skipped on $os_type"
run zinit for @alacritty/alacritty; assert $state equals 0
local alacritty="$ZBIN/alacritty"; assert "$alacritty" is_executable
$alacritty --version; assert $state equals 0
run "$alacritty" --version; assert $state equals 0
}
@test 'alist' { # A file list program that supports multiple storage, powered by Gin and React
run zinit lbin'!* -> alist' for @alist-org/alist; assert $state equals 0
local alist="$ZBIN/alist"; assert "$alist" is_executable
run $alist version; assert $state equals 0
run "$alist" version; assert $state equals 0
}
@test 'asciigraph' { # Go package to make lightweight ASCII line graphs in command line apps with no external dependencies.
run zinit for @guptarohit/asciigraph; assert $state equals 0
local asciigraph="$ZBIN/asciigraph"; assert "$asciigraph" is_executable
run $asciigraph --help; assert $state equals 0
run "$asciigraph" --help; assert $state equals 0
}
@test 'assh' { # make your ssh client smarter
run zinit for @moul/assh; assert $state equals 0
local assh="$ZBIN/assh"; assert "$assh" is_executable
run $assh --version; assert $state equals 0
run "$assh" --version; assert $state equals 0
}
@test 'atuin' { # Magical shell history
run zinit for @atuinsh/atuin; assert $state equals 0
local atuin="$ZBIN/atuin"; assert "$atuin" is_executable
run $atuin --version; assert $state equals 0
run "$atuin" --version; assert $state equals 0
}
@test 'aurora' { # Cross-platform beanstalkd queue server admin console
run zinit for @xuri/aurora; assert $state equals 0
local aurora="$ZBIN/aurora"; assert "$aurora" is_executable
run $aurora -v; assert $state equals 0
run "$aurora" -v; assert $state equals 0
}
@test 'bandwhich' { # Terminal bandwidth utilization tool
[[ $OSTYPE =~ 'darwin*' ]] && skip "on $os_type"
Expand All @@ -58,34 +58,34 @@
@test 'bat' { # A cat(1) clone with wings
run zinit for @sharkdp/bat; assert $state equals 0
local bat="$ZBIN/bat"; assert "$bat" is_executable
run $bat --version; assert $state equals 0
run "$bat" --version; assert $state equals 0
}
@test 'bazel' { # a fast, scalable, multi-language and extensible build system
run zinit lbin"!bazel* -> bazel" for @bazelbuild/bazel; assert $state equals 0
local bazel="$ZBIN/bazel"; assert "$bazel" is_executable
run $bazel --version; assert $state equals 0
run "$bazel" --version; assert $state equals 0
}
@test 'blast' { # Blast is a simple tool for API load testing and batch jobs
[[ $OSTYPE =~ 'darwin*' ]] && skip "on $os_type"
run zinit for @dave/blast; assert $state equals 0
local blast="$ZBIN/blast"; assert "$blast" is_executable
run $blast --dry=1; assert $state equals 0
run "$blast" --dry=1; assert $state equals 0
}
@test 'boilr' { # boilerplate template manager that generates files or directories from template repositories
run zinit for @tmrts/boilr; assert $state equals 0
local boilr="$ZBIN/boilr"; assert "$boilr" is_executable
[[ $OSTYPE =~ 'darwin*' ]] && assert "$output" contains "darwin_amd64" && pass
run $boilr --help; assert $state equals 0
run "$boilr" --help; assert $state equals 0
}
@test 'booklit' { # a pretty lit content authoring system
run zinit for lbin'!* -> booklit' @vito/booklit; assert $state equals 0
local booklit="$ZBIN/booklit"; assert "$booklit" is_executable
run "$booklit" --version; assert $state equals 0
}
@test 'bottom' { # Yet another cross-platform graphical process/system monitor
run zinit lbin'!**/btm' for ClementTsang/bottom; assert $state equals 0
run zinit lbin'!btm' for ClementTsang/bottom; assert $state equals 0
local bottom="$ZBIN/btm"; assert "$bottom" is_executable
run $bottom --version; assert $state equals 0
run "$bottom" --version; assert $state equals 0
}
@test 'broot' { # A new way to see and navigate directory trees
[[ $OSTYPE =~ 'darwin*' ]] && skip " on $os_type"
Expand All @@ -94,19 +94,19 @@
run "$broot" --version; assert $state equals 0
}
@test 'btop' { # A monitor of resources
run zinit lbin'!**/btop' for aristocratos/btop; assert $state equals 0
run zinit ver'v1.2.13' for aristocratos/btop; assert $state equals 0
local btop="$ZBIN/btop"; assert "$btop" is_executable
run $btop --version; assert $state equals 0
run "$btop" --version; assert $state equals 0
}
@test 'calico' { # Cloud native networking and network security
run zinit lbin"!* -> calico" for @projectcalico/calico; assert $state equals 0
run zinit lbin'!* -> calico' for @projectcalico/calico; assert $state equals 0
local calico="$ZBIN/calico"; assert "$calico" is_executable
run $calico --version; assert $state equals 0
run "$calico" version; assert $state equals 0
}
@test 'certificates' { # An opinionated helper for generating tls certificates
run zinit lbin"!* -> certificates" for @mvmaasakkers/certificates; assert $state equals 0
run zinit lbin'!* -> certificates' for @mvmaasakkers/certificates; assert $state equals 0
local certificates="$ZBIN/certificates"; assert "$certificates" is_executable
run $certificates --version; assert $state equals 0
run "$certificates" --version; assert $state equals 0
}
@test 'checkmake' { # experimental linter/analyzer for Makefiles
run zinit lbin'!checkmake* -> checkmake' for @mrtazz/checkmake; assert $state equals 0
Expand Down Expand Up @@ -145,7 +145,7 @@
run $delta --version; assert $state equals 0
}
@test 'difftastic' { # A structural diff that understands syntax
run zinit id-as'difft' for @Wilfred/difftastic; assert $state equals 0
run zinit lbin'!difft' for @Wilfred/difftastic; assert $state equals 0
local difftastic="$ZBIN/difft"; assert "$difftastic" is_executable
run $difftastic --version; assert $state equals 0
}
Expand Down Expand Up @@ -181,22 +181,22 @@
run $dstask version; assert $state equals 0
}
@test 'dua' { # View disk space usage and delete unwanted data, fast
run zinit ver'v2.20.3' lbin'!**/dua' for @Byron/dua-cli; assert $state equals 0
run zinit ver'v2.20.3' lbin'!dua' for @Byron/dua-cli; assert $state equals 0
local dua="$ZBIN/dua"; assert "$dua" is_executable
run $dua --version; assert $state equals 0
}
@test 'duci' { # The simple CI server
run zinit lbin'!**/duci' for @duck8823/duci; assert $state equals 0
run zinit for @duck8823/duci; assert $state equals 0
local duci="$ZBIN/duci"; assert "$duci" is_executable
run $duci version; assert $state equals 0
}
@test 'dust' { # A more intuitive version of du in rust
run zinit lbin'!**/dust' for @bootandy/dust; assert $state equals 0
run zinit for @bootandy/dust; assert $state equals 0
local dust="$ZBIN/dust"; assert "$dust" is_executable
run $dust --version; assert $state equals 0
}
@test 'dyff' { # diff tool for YAML files, and sometimes JSON
run zinit lbin'!**/dyff' for @homeport/dyff; assert $state equals 0
run zinit for @homeport/dyff; assert $state equals 0
local dyff="$ZBIN/dyff"; assert "$dyff" is_executable
run $dyff version; assert $state equals 0
}
Expand All @@ -207,12 +207,12 @@
run $dysk --version; assert $state equals 0
}
@test 'etcd' { # Distributed reliable key-value store for the most critical data of a distributed system
run zinit lbin'!**/etcd' for @etcd-io/etcd; assert $state equals 0
run zinit for @etcd-io/etcd; assert $state equals 0
local etcd="$ZBIN/etcd"; assert "$etcd" is_executable
run $etcd --version; assert $state equals 0
}
@test 'exa' { # A modern replacement for ls
run zinit lbin'!**/exa' for @ogham/exa; assert $state equals 0
run zinit for @ogham/exa; assert $state equals 0
local exa="$ZBIN/exa"; assert "$exa" is_executable
run $exa --version; assert $state equals 0
}
Expand Down Expand Up @@ -269,7 +269,7 @@
run $git_sizer --version; assert $state equals 0
}
@test 'gh-cli' { # GitHub’s official command line tool
run zinit lbin'!**/gh' for @cli/cli; assert $state equals 0
run zinit lbin'!gh' for @cli/cli; assert $state equals 0
local gh_cli="$ZBIN/gh"; assert "$gh_cli" is_executable
run $gh_cli --version; assert $state equals 0
}
Expand All @@ -281,33 +281,37 @@
@test 'ghg' { # Get the executable from github releases easily
run zinit for @Songmu/ghg; assert $state equals 0
local ghg="$ZBIN/ghg"; assert "$ghg" is_executable
run $ghg version; assert $state equals 0
run "$ghg" version; assert $state equals 0
}
@test 'ghq' { # Remote repository management made easy
run zinit for @x-motemen/ghq; assert $state equals 0
local ghq="$ZBIN/ghq"; assert "$ghq" is_executable
run $ghq --version; assert $state equals 0
run "$ghq" --version; assert $state equals 0
}
@test 'git-absorb' { # git commit --fixup, but automatic
run zinit for @tummychow/git-absorb; assert $state equals 0
local git_absorb="$ZBIN/git-absorb"; assert "$git_absorb" is_executable
run $git_absorb --version; assert $state equals 0
run "$git_absorb" --version; assert $state equals 0
}
@test 'git-chglog' { # CHANGELOG generator implemented in Go
@test 'git-chglog' { # CHANGELOG generator implemented in Go (Golang).
run zinit for @git-chglog/git-chglog; assert $state equals 0
local git_chglog="$ZBIN/git-chglog"; assert "$git_chglog" is_executable
run $git_chglog --version; assert $state equals 0
run "$git_chglog" --version; assert $state equals 0
}
@test 'git-mkver' { # Automatic Semantic Versioning for git based software development
run zinit ver'v1.2.2' for @idc101/git-mkver; assert $state equals 0
local git_mkver="$ZBIN/git-mkver"; assert "$git_mkver" is_executable
# use git-mkver info because --version exits with 130?
run $git_mkver info; assert $state equals 0
run "$git_mkver" info; assert $state equals 0
}
@test 'git-sizer' { # Compute various size metrics for a Git repository, flagging those that might cause problems
run zinit for @github/git-sizer; assert $state equals 0
local git_sizer="$ZBIN/git-sizer"; assert "$git_sizer" is_executable
run $git_sizer --version; assert $state equals 0
run "$git_sizer" --version; assert $state equals 0
}
@test 'gitui' { # Blazing fast terminal-ui for git written in rust
run zinit for @extrawurst/gitui; assert $state equals 0
local gitui="$ZBIN/gitui"; assert "$gitui" is_executable
run "$gitui" --version; assert $state equals 0
}
@test 'glow' { # Render markdown on the CLI, with pizzazz
run zinit for @charmbracelet/glow; assert $state equals 0
Expand Down Expand Up @@ -378,7 +382,7 @@
run $heksa --version; assert $state equals 0
}
@test 'helix' { # A post-modern modal text editor
run zinit lbin'!**/hx' for @helix-editor/helix; assert $state equals 0
run zinit lbin'!hx' for @helix-editor/helix; assert $state equals 0
local helix="$ZBIN/hx"; assert "$helix" is_executable
run $helix --version; assert $state equals 0
}
Expand Down Expand Up @@ -470,7 +474,7 @@
run $krew version; assert $state equals 0
}
@test 'kubedb' { # `kubectl` plugin for KubeDB
run zinit for id-as'kubedb' lbin'*->kubedb' @kubedb/cli; assert $state equals 0
run zinit for lbin'kube*->kubedb' @kubedb/cli; assert $state equals 0
local cli="$ZBIN/kubedb"; assert "$cli" is_executable
run "$cli" version; assert $state equals 0
}
Expand Down Expand Up @@ -528,7 +532,7 @@
}
@test 'mas' { # Mac App Store command line interface
[[ $OSTYPE =~ 'linux*' ]] && skip "skipped on $os_type"
run zinit lbin'!**/bin/mas' for @mas-cli/mas; assert $state equals 0
run zinit for @mas-cli/mas; assert $state equals 0
local mas="$ZBIN/mas"; assert "$mas" is_executable
run $mas version; assert $state equals 0
}
Expand Down Expand Up @@ -594,7 +598,7 @@
run $mob --version; assert $state equals 0
}
@test 'mocword' { # Predict next words
run zinit lbin'!**/mocword* -> mocword' for @high-moctane/mocword; assert $state equals 0
run zinit lbin'!mocword* -> mocword' for @high-moctane/mocword; assert $state equals 0
local mocword="$ZBIN/mocword"; assert "$mocword" is_executable
run $mocword --version; assert $state equals 0
}
Expand All @@ -605,7 +609,7 @@
run $monolith --version; assert $state equals 0
}
@test 'moonwalk' { # Cover your tracks during Linux Exploitation by leaving zero traces on system logs and filesystem timestamps
run zinit lbin'!**/moonwalk* -> moonwalk' for @mufeedvh/moonwalk; assert $state equals 0
run zinit lbin'!moonwalk* -> moonwalk' for @mufeedvh/moonwalk; assert $state equals 0
local moonwalk="$ZBIN/moonwalk"; assert "$moonwalk" is_executable
run $moonwalk --version; assert $state equals 0
}
Expand Down Expand Up @@ -697,7 +701,7 @@
run "$rip" --version; assert $state equals 0
}
@test 'ripgrep' { # Recursively searches directories for a regex pattern while respecting your gitignore
run zinit lbin'!**/rg' for @BurntSushi/ripgrep; assert $state equals 0
run zinit lbin'!rg' for @BurntSushi/ripgrep; assert $state equals 0
local rg="$ZBIN/rg"; assert "$rg" is_executable
run "$rg" --version; assert $state equals 0
}
Expand Down Expand Up @@ -733,7 +737,7 @@
run "$shellcheck" --version; assert $state equals 0
}
@test 'shfmt' { # A shell parser, formatter, and interpreter with bash support
run zinit lbin'!**/sh* -> shfmt' for @mvdan/sh; assert $state equals 0
run zinit lbin'!sh* -> shfmt' for @mvdan/sh; assert $state equals 0
local shfmt="$ZBIN/shfmt"; assert "$shfmt" is_executable
run $shfmt --version; assert $state equals 0
}
Expand All @@ -742,6 +746,11 @@
local skim="$ZBIN/sk"; assert "$skim" is_executable
run "$skim" --version; assert $state equals 0
}
@test 'snm' { # Smol and simple node version manager written in rust
run zinit for @numToStr/snm; assert $state equals 0
local snm="$ZBIN/snm"; assert "$snm" is_executable
run "$snm" --version; assert $state equals 0
}
@test 'starship' { # The minimal, blazing-fast, and infinitely customizable prompt for any shell
run zinit for @starship/starship; assert $state equals 0
local starship="$ZBIN/starship"; assert "$starship" is_executable
Expand Down Expand Up @@ -815,7 +824,7 @@
run $wifiqr --version; assert $state equals 0
}
@test 'wtf' { # The personal information dashboard for your terminal
run zinit lbin'!**/wtf* -> wtf' for wtfutil/wtf; assert $state equals 0
run zinit lbin'!wtf* -> wtf' for wtfutil/wtf; assert $state equals 0
local wtf="$ZBIN/wtf"; assert "$wtf" is_executable
run $wtf --version; assert $state equals 0
}
Expand Down
17 changes: 9 additions & 8 deletions zinit-install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
local url=https://$urlpart
fi
init_list=( ${(@f)"$( { .zinit-download-file-stdout $url || .zinit-download-file-stdout $url 1; } 2>/dev/null | command grep -i -o 'href=./'$user'/'$plugin'/releases/download/[^"]\+')"} )
init_list=(${init_list[@]#href=?})
init_list=(${(L)init_list[@]#href=?})
bpicks=(${(s.;.)ICE[bpick]})
[[ -z $bpicks ]] && bpicks=("")
local bpick bpick_error=""
Expand All @@ -1559,8 +1559,9 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
+zi-log "{e} {b}gh-r{rst}: {ice}bpick{rst} ice found no release assets To fix, modify the {ice}bpick{rst} glob pattern {glob}$bpick{rst}"
fi
else
local junk="(386|md5|sig|asc|txt|vsix|sum|sha256*|pkg|([\.]apk|deb|json|rpm|sh))"
filtered=( ${list[@]:#(#i)*${~junk}*} ) && (( $#filtered > 0 )) && list=( ${filtered[@]} )
local junk='*((s(ha256|ig|um)|vsix|asc|md5|386|txt)*|(apk|deb|json|pkg|rpm|sh|zst)(#e|.))';
# print -l ${${(m@)list:#${~junk}}:t}
filtered=( ${(m@)list:#(#i)${~junk}} ) && (( $#filtered > 0 )) && list=( ${filtered[@]} )
fi

local -a array=( $(print -rm "*(${MACHTYPE}|${VENDOR}|)*~^*(${parts[1]}|${(L)$(uname)})*" $list[@]) )
Expand Down Expand Up @@ -1715,19 +1716,19 @@ ziextract() {
→zinit-extract() { →zinit-check unrar "$file" || return 1; command unrar x "$file"; }
;;
((#i)*.tar.bz2|(#i)*.tbz|(#i)*.tbz2)
→zinit-extract() { →zinit-check bzip2 "$file" || return 1; command bzip2 -dc "$file" | command tar -xf -; }
→zinit-extract() { →zinit-check bzip2 "$file" || return 1; command bzip2 -dc "$file" | command tar --no-same-owner -xf -; }
;;
((#i)*.tar.gz|(#i)*.tgz)
→zinit-extract() { →zinit-check gzip "$file" || return 1; command gzip -dc "$file" | command tar -xf -; }
→zinit-extract() { →zinit-check gzip "$file" || return 1; command gzip -dc "$file" | command tar --no-same-owner -xf -; }
;;
((#i)*.tar.xz|(#i)*.txz)
→zinit-extract() { →zinit-check xz "$file" || return 1; command xz -dc "$file" | command tar -xf -; }
→zinit-extract() { →zinit-check xz "$file" || return 1; command xz -dc "$file" | command tar --no-same-owner -xf -; }
;;
((#i)*.tar.7z|(#i)*.t7z)
→zinit-extract() { →zinit-check 7z "$file" || return 1; command 7z x -so "$file" | command tar -xf -; }
→zinit-extract() { →zinit-check 7z "$file" || return 1; command 7z x -so "$file" | command tar --no-same-owner -xf -; }
;;
((#i)*.tar)
→zinit-extract() { →zinit-check tar "$file" || return 1; command tar -xf "$file"; }
→zinit-extract() { →zinit-check tar "$file" || return 1; command tar --no-same-owner -xf "$file"; }
;;
((#i)*.gz|(#i)*.gzip)
if [[ $file != (#i)*.gz ]] {
Expand Down

0 comments on commit 4c12946

Please sign in to comment.