Skip to content

Commit

Permalink
setup-util-*: peformance check now works with --optional and other args
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Sep 4, 2023
1 parent ac88cd3 commit 2609761
Show file tree
Hide file tree
Showing 70 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion commands/setup-util-1password-cli
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function setup_util_1password() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists op; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists op; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-amp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function setup_util_amp() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists amp; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists amp; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-appimage
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function setup_util_appimage() (
arch="$(get-arch)"
for bin in "${tools[@]}"; do
# improve performance
if test "$*" = '--quiet' && command-exists "$bin"; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists "$bin"; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-aria2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function setup_util_aria2() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists aria2c; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists aria2c; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-bandwhich
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function setup_util_bandwhich() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists bandwhich; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists bandwhich; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-bat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function setup_util_bat() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists bat; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists bat; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-bottom
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function setup_util_bottom() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists btm; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists btm; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-brave
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function setup_util_brave() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && get-app --quiet 'Brave Browser'; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && get-app --quiet 'Brave Browser'; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-curl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function setup_util_curl() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists curl; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists curl; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-delta
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function setup_util_delta() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists delta; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists delta; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-deno
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function setup_util_deno() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists deno; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists deno; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-dust
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function setup_util_dust() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists dust; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists dust; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-exa
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function setup_util_exa() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists exa; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists exa; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-fd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function setup_util_fd() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists fd; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists fd; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-fish
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function setup_util_fish() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists fish; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists fish; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-flatpak
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function setup_util_flatpak() (
fi

# improve performance
if test "$*" = '--quiet' && command-exists flatpak; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists flatpak; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-fzf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function setup_util_fzf() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists fzf; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists fzf; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-gh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function setup_util_gh() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists gh; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists gh; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-ghostscript
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function setup_util_ghostscript() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists gxps; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists gxps; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-glab
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function setup_util_glab() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists glab; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists glab; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-gnome-software
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function setup_util_gnome_software() (
fi

# improve performance
if test "$*" = '--quiet' && command-exists gnome-software; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists gnome-software; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function setup_util_go() (
# fi

# improve performance
if test "$*" = '--quiet' && command-exists go; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists go; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-gocryptfs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function setup_util_gocryptfs() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists gocryptfs; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists gocryptfs; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-got
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function setup_util_got() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists got; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists got; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-grex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function setup_util_grex() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists grex; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists grex; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-httpie
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function setup_util_httpie() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists http; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists http; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-hyperfine
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function setup_util_hyperfine() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists hyperfine; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists hyperfine; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-jq
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function setup_util_jq() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists jq; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists jq; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-krypton
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function setup_util_krypton() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists krgpg; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists krgpg; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-linux-purge
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function setup_util_linux_purge() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists linux-purge; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists linux-purge; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-mas
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function setup_util_mas() (
fi

# improve performance
if test "$*" = '--quiet' && command-exists mas; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists mas; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-micro
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function setup_util_micro() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists micro; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists micro; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-moreutils
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function setup_util_moreutils() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists errno; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists errno; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-nano
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function setup_util_nano() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists nano; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists nano; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-ne
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function setup_util_ne() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists ne; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists ne; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-neovim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function setup_util_neovim() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists nvim; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists nvim; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-netscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function setup_util_netscript() (
fi

# improve performance
if test "$*" = '--quiet' && command-exists ifup; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists ifup; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-netstat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function setup_util_netstat() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists netstat; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists netstat; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-nu
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function setup_util_nu() (
}

# improve performance
if test "$*" = '--quiet' && command-exists nu; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists nu; then
do_configure
return 0
fi
Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-obs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function setup_util_obs() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && get-app --quiet 'OBS'; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && get-app --quiet 'OBS'; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-openvpn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function setup_util_openvpn() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists openvpn; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists openvpn; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-pamac
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function setup_util_pamac() (
fi

# improve performance
if test "$*" = '--quiet' && command-exists pamac; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists pamac; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-prettier
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function setup_util_prettier() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists prettier; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists prettier; then
return 0
fi

Expand Down
2 changes: 1 addition & 1 deletion commands/setup-util-procs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function setup_util_procs() (
source "$DOROTHY/sources/bash.bash"

# improve performance
if test "$*" = '--quiet' && command-exists procs; then
if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists procs; then
return 0
fi

Expand Down
Loading

0 comments on commit 2609761

Please sign in to comment.