From 26097611b8a76c95fce79952fe95d976922c18c7 Mon Sep 17 00:00:00 2001 From: Benjamin Lupton Date: Mon, 4 Sep 2023 23:42:15 +0800 Subject: [PATCH] setup-util-*: peformance check now works with --optional and other args --- commands/setup-util-1password-cli | 2 +- commands/setup-util-amp | 2 +- commands/setup-util-appimage | 2 +- commands/setup-util-aria2 | 2 +- commands/setup-util-bandwhich | 2 +- commands/setup-util-bat | 2 +- commands/setup-util-bottom | 2 +- commands/setup-util-brave | 2 +- commands/setup-util-curl | 2 +- commands/setup-util-delta | 2 +- commands/setup-util-deno | 2 +- commands/setup-util-dust | 2 +- commands/setup-util-exa | 2 +- commands/setup-util-fd | 2 +- commands/setup-util-fish | 2 +- commands/setup-util-flatpak | 2 +- commands/setup-util-fzf | 2 +- commands/setup-util-gh | 2 +- commands/setup-util-ghostscript | 2 +- commands/setup-util-glab | 2 +- commands/setup-util-gnome-software | 2 +- commands/setup-util-go | 2 +- commands/setup-util-gocryptfs | 2 +- commands/setup-util-got | 2 +- commands/setup-util-grex | 2 +- commands/setup-util-httpie | 2 +- commands/setup-util-hyperfine | 2 +- commands/setup-util-jq | 2 +- commands/setup-util-krypton | 2 +- commands/setup-util-linux-purge | 2 +- commands/setup-util-mas | 2 +- commands/setup-util-micro | 2 +- commands/setup-util-moreutils | 2 +- commands/setup-util-nano | 2 +- commands/setup-util-ne | 2 +- commands/setup-util-neovim | 2 +- commands/setup-util-netscript | 2 +- commands/setup-util-netstat | 2 +- commands/setup-util-nu | 2 +- commands/setup-util-obs | 2 +- commands/setup-util-openvpn | 2 +- commands/setup-util-pamac | 2 +- commands/setup-util-prettier | 2 +- commands/setup-util-procs | 2 +- commands/setup-util-pv | 2 +- commands/setup-util-recode | 2 +- commands/setup-util-ripgrep | 2 +- commands/setup-util-rmesg | 2 +- commands/setup-util-screen | 2 +- commands/setup-util-sd | 2 +- commands/setup-util-shellcheck | 2 +- commands/setup-util-shfmt | 2 +- commands/setup-util-signal | 2 +- commands/setup-util-snap | 2 +- commands/setup-util-sshd | 2 +- commands/setup-util-starship | 2 +- commands/setup-util-strongbox | 2 +- commands/setup-util-tea | 2 +- commands/setup-util-tealdeer | 2 +- commands/setup-util-teip | 2 +- commands/setup-util-tokei | 2 +- commands/setup-util-trash | 2 +- commands/setup-util-trunk | 2 +- commands/setup-util-vhs | 2 +- commands/setup-util-vim | 2 +- commands/setup-util-vnc | 2 +- commands/setup-util-warp | 2 +- commands/setup-util-wget | 2 +- commands/setup-util-zoxide | 2 +- commands/setup-util-zsh | 2 +- 70 files changed, 70 insertions(+), 70 deletions(-) diff --git a/commands/setup-util-1password-cli b/commands/setup-util-1password-cli index 03581e92f..35a6d4547 100755 --- a/commands/setup-util-1password-cli +++ b/commands/setup-util-1password-cli @@ -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 diff --git a/commands/setup-util-amp b/commands/setup-util-amp index 93caee934..577de95e3 100755 --- a/commands/setup-util-amp +++ b/commands/setup-util-amp @@ -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 diff --git a/commands/setup-util-appimage b/commands/setup-util-appimage index 8da965ef2..d8df33554 100755 --- a/commands/setup-util-appimage +++ b/commands/setup-util-appimage @@ -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 diff --git a/commands/setup-util-aria2 b/commands/setup-util-aria2 index ba9913611..3928610e9 100755 --- a/commands/setup-util-aria2 +++ b/commands/setup-util-aria2 @@ -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 diff --git a/commands/setup-util-bandwhich b/commands/setup-util-bandwhich index ed80b152e..5052bb263 100755 --- a/commands/setup-util-bandwhich +++ b/commands/setup-util-bandwhich @@ -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 diff --git a/commands/setup-util-bat b/commands/setup-util-bat index f0f41a0b8..44f8703e5 100755 --- a/commands/setup-util-bat +++ b/commands/setup-util-bat @@ -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 diff --git a/commands/setup-util-bottom b/commands/setup-util-bottom index 291a98082..2b8fcbe42 100755 --- a/commands/setup-util-bottom +++ b/commands/setup-util-bottom @@ -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 diff --git a/commands/setup-util-brave b/commands/setup-util-brave index 3e2f86a1d..143c43f4c 100755 --- a/commands/setup-util-brave +++ b/commands/setup-util-brave @@ -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 diff --git a/commands/setup-util-curl b/commands/setup-util-curl index 9fca86dbb..2bf9faa49 100755 --- a/commands/setup-util-curl +++ b/commands/setup-util-curl @@ -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 diff --git a/commands/setup-util-delta b/commands/setup-util-delta index 468a4b6c0..7788ed87f 100755 --- a/commands/setup-util-delta +++ b/commands/setup-util-delta @@ -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 diff --git a/commands/setup-util-deno b/commands/setup-util-deno index 9465cb28c..a67d3a3b5 100755 --- a/commands/setup-util-deno +++ b/commands/setup-util-deno @@ -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 diff --git a/commands/setup-util-dust b/commands/setup-util-dust index 1d46b4fc0..4e14b3cb0 100755 --- a/commands/setup-util-dust +++ b/commands/setup-util-dust @@ -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 diff --git a/commands/setup-util-exa b/commands/setup-util-exa index 38310780e..60f72e84e 100755 --- a/commands/setup-util-exa +++ b/commands/setup-util-exa @@ -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 diff --git a/commands/setup-util-fd b/commands/setup-util-fd index ae18bde68..fd8d1c7be 100755 --- a/commands/setup-util-fd +++ b/commands/setup-util-fd @@ -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 diff --git a/commands/setup-util-fish b/commands/setup-util-fish index 2a50d2b19..075b7a47a 100755 --- a/commands/setup-util-fish +++ b/commands/setup-util-fish @@ -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 diff --git a/commands/setup-util-flatpak b/commands/setup-util-flatpak index 0db38dcc8..e61428996 100755 --- a/commands/setup-util-flatpak +++ b/commands/setup-util-flatpak @@ -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 diff --git a/commands/setup-util-fzf b/commands/setup-util-fzf index 6d50d02e4..14f373adf 100755 --- a/commands/setup-util-fzf +++ b/commands/setup-util-fzf @@ -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 diff --git a/commands/setup-util-gh b/commands/setup-util-gh index f7dacb133..cca582369 100755 --- a/commands/setup-util-gh +++ b/commands/setup-util-gh @@ -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 diff --git a/commands/setup-util-ghostscript b/commands/setup-util-ghostscript index aa86ed44a..d9d13675c 100755 --- a/commands/setup-util-ghostscript +++ b/commands/setup-util-ghostscript @@ -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 diff --git a/commands/setup-util-glab b/commands/setup-util-glab index 1db405587..24df41e06 100755 --- a/commands/setup-util-glab +++ b/commands/setup-util-glab @@ -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 diff --git a/commands/setup-util-gnome-software b/commands/setup-util-gnome-software index 3bf0758c8..7907f0ac0 100755 --- a/commands/setup-util-gnome-software +++ b/commands/setup-util-gnome-software @@ -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 diff --git a/commands/setup-util-go b/commands/setup-util-go index d789ea6a0..be8101251 100755 --- a/commands/setup-util-go +++ b/commands/setup-util-go @@ -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 diff --git a/commands/setup-util-gocryptfs b/commands/setup-util-gocryptfs index abbf3567e..8bd3a44c7 100755 --- a/commands/setup-util-gocryptfs +++ b/commands/setup-util-gocryptfs @@ -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 diff --git a/commands/setup-util-got b/commands/setup-util-got index 8b6dffc22..8ed4b6b13 100755 --- a/commands/setup-util-got +++ b/commands/setup-util-got @@ -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 diff --git a/commands/setup-util-grex b/commands/setup-util-grex index 04a077452..008170e3b 100755 --- a/commands/setup-util-grex +++ b/commands/setup-util-grex @@ -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 diff --git a/commands/setup-util-httpie b/commands/setup-util-httpie index 50b4b0da9..ea92b514c 100755 --- a/commands/setup-util-httpie +++ b/commands/setup-util-httpie @@ -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 diff --git a/commands/setup-util-hyperfine b/commands/setup-util-hyperfine index 4b9532d73..13126f95f 100755 --- a/commands/setup-util-hyperfine +++ b/commands/setup-util-hyperfine @@ -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 diff --git a/commands/setup-util-jq b/commands/setup-util-jq index 356b27f0e..7c427676e 100755 --- a/commands/setup-util-jq +++ b/commands/setup-util-jq @@ -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 diff --git a/commands/setup-util-krypton b/commands/setup-util-krypton index 5a2bcac56..161fe1792 100755 --- a/commands/setup-util-krypton +++ b/commands/setup-util-krypton @@ -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 diff --git a/commands/setup-util-linux-purge b/commands/setup-util-linux-purge index e0101caf6..bc1e0ebf8 100755 --- a/commands/setup-util-linux-purge +++ b/commands/setup-util-linux-purge @@ -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 diff --git a/commands/setup-util-mas b/commands/setup-util-mas index 59beb4d73..cdd83d2e3 100755 --- a/commands/setup-util-mas +++ b/commands/setup-util-mas @@ -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 diff --git a/commands/setup-util-micro b/commands/setup-util-micro index 8ec583260..b4ff5a457 100755 --- a/commands/setup-util-micro +++ b/commands/setup-util-micro @@ -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 diff --git a/commands/setup-util-moreutils b/commands/setup-util-moreutils index 144adddf9..d21d75a86 100755 --- a/commands/setup-util-moreutils +++ b/commands/setup-util-moreutils @@ -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 diff --git a/commands/setup-util-nano b/commands/setup-util-nano index fc921bcf9..ff3272882 100755 --- a/commands/setup-util-nano +++ b/commands/setup-util-nano @@ -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 diff --git a/commands/setup-util-ne b/commands/setup-util-ne index 6bcf34928..124a9dca4 100755 --- a/commands/setup-util-ne +++ b/commands/setup-util-ne @@ -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 diff --git a/commands/setup-util-neovim b/commands/setup-util-neovim index d08f98b6b..e4bbaf053 100755 --- a/commands/setup-util-neovim +++ b/commands/setup-util-neovim @@ -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 diff --git a/commands/setup-util-netscript b/commands/setup-util-netscript index 52edc18f3..2a451d9c5 100755 --- a/commands/setup-util-netscript +++ b/commands/setup-util-netscript @@ -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 diff --git a/commands/setup-util-netstat b/commands/setup-util-netstat index 0b5a59fe8..d6114706a 100755 --- a/commands/setup-util-netstat +++ b/commands/setup-util-netstat @@ -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 diff --git a/commands/setup-util-nu b/commands/setup-util-nu index b06bb851e..925196df3 100755 --- a/commands/setup-util-nu +++ b/commands/setup-util-nu @@ -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 diff --git a/commands/setup-util-obs b/commands/setup-util-obs index ddc22f5d5..a64e4d2ab 100755 --- a/commands/setup-util-obs +++ b/commands/setup-util-obs @@ -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 diff --git a/commands/setup-util-openvpn b/commands/setup-util-openvpn index 4cfc33e58..231763809 100755 --- a/commands/setup-util-openvpn +++ b/commands/setup-util-openvpn @@ -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 diff --git a/commands/setup-util-pamac b/commands/setup-util-pamac index 41b535cff..f17b89c60 100755 --- a/commands/setup-util-pamac +++ b/commands/setup-util-pamac @@ -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 diff --git a/commands/setup-util-prettier b/commands/setup-util-prettier index c978600ff..bc9c14e2f 100755 --- a/commands/setup-util-prettier +++ b/commands/setup-util-prettier @@ -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 diff --git a/commands/setup-util-procs b/commands/setup-util-procs index 2117d954c..2530f39e4 100755 --- a/commands/setup-util-procs +++ b/commands/setup-util-procs @@ -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 diff --git a/commands/setup-util-pv b/commands/setup-util-pv index 7e6a1cdea..8b3ba8194 100755 --- a/commands/setup-util-pv +++ b/commands/setup-util-pv @@ -7,7 +7,7 @@ function setup_util_pv() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists pv; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists pv; then return 0 fi diff --git a/commands/setup-util-recode b/commands/setup-util-recode index 2a5e57bc9..f45c0a6ed 100755 --- a/commands/setup-util-recode +++ b/commands/setup-util-recode @@ -18,7 +18,7 @@ function setup_util_recode() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists recode; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists recode; then return 0 fi diff --git a/commands/setup-util-ripgrep b/commands/setup-util-ripgrep index cadfacd92..4a84af955 100755 --- a/commands/setup-util-ripgrep +++ b/commands/setup-util-ripgrep @@ -28,7 +28,7 @@ function setup_util_ripgrep() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists rg; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists rg; then return 0 fi diff --git a/commands/setup-util-rmesg b/commands/setup-util-rmesg index 7750a1d8f..0277bcc1d 100755 --- a/commands/setup-util-rmesg +++ b/commands/setup-util-rmesg @@ -8,7 +8,7 @@ function setup_util_rmesg() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists rmesg; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists rmesg; then return 0 fi diff --git a/commands/setup-util-screen b/commands/setup-util-screen index 1743fa7b0..121dd8071 100755 --- a/commands/setup-util-screen +++ b/commands/setup-util-screen @@ -7,7 +7,7 @@ function setup_util_screen() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists screen; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists screen; then return 0 fi diff --git a/commands/setup-util-sd b/commands/setup-util-sd index 689d6c1a8..97b034fa3 100755 --- a/commands/setup-util-sd +++ b/commands/setup-util-sd @@ -24,7 +24,7 @@ function setup_util_sd() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists sd; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists sd; then return 0 fi diff --git a/commands/setup-util-shellcheck b/commands/setup-util-shellcheck index 1b3cd6dbd..3019ce50e 100755 --- a/commands/setup-util-shellcheck +++ b/commands/setup-util-shellcheck @@ -18,7 +18,7 @@ function setup_util_shellcheck() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists shellcheck; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists shellcheck; then return 0 fi diff --git a/commands/setup-util-shfmt b/commands/setup-util-shfmt index ec406ed75..8fa949174 100755 --- a/commands/setup-util-shfmt +++ b/commands/setup-util-shfmt @@ -19,7 +19,7 @@ function setup_util_shfmt() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists shfmt; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists shfmt; then return 0 fi diff --git a/commands/setup-util-signal b/commands/setup-util-signal index 5338ae753..58ad3622e 100755 --- a/commands/setup-util-signal +++ b/commands/setup-util-signal @@ -7,7 +7,7 @@ function setup_util_signal() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && get-app --quiet 'Signal'; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && get-app --quiet 'Signal'; then return 0 fi diff --git a/commands/setup-util-snap b/commands/setup-util-snap index bb571e61f..e6e04c880 100755 --- a/commands/setup-util-snap +++ b/commands/setup-util-snap @@ -22,7 +22,7 @@ function setup_util_snap() ( fi # improve performance - if test "$*" = '--quiet' && command-exists snap; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists snap; then return 0 fi diff --git a/commands/setup-util-sshd b/commands/setup-util-sshd index eaf25ee2a..d1d18f0dc 100755 --- a/commands/setup-util-sshd +++ b/commands/setup-util-sshd @@ -7,7 +7,7 @@ function setup_util_sshd() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists sshd; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists sshd; then return 0 fi diff --git a/commands/setup-util-starship b/commands/setup-util-starship index 45322084e..a2338b61c 100755 --- a/commands/setup-util-starship +++ b/commands/setup-util-starship @@ -23,7 +23,7 @@ function setup_util_starship() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists starship; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists starship; then return 0 fi diff --git a/commands/setup-util-strongbox b/commands/setup-util-strongbox index ce5bea99f..9d22a42a9 100755 --- a/commands/setup-util-strongbox +++ b/commands/setup-util-strongbox @@ -24,7 +24,7 @@ function setup_util_strongbox() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists strongbox; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists strongbox; then return 0 fi diff --git a/commands/setup-util-tea b/commands/setup-util-tea index 5607e4b0f..247305e68 100755 --- a/commands/setup-util-tea +++ b/commands/setup-util-tea @@ -18,7 +18,7 @@ function setup_util_tea() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists tea; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists tea; then return 0 fi diff --git a/commands/setup-util-tealdeer b/commands/setup-util-tealdeer index a5ef4fb1d..b772d5b1a 100755 --- a/commands/setup-util-tealdeer +++ b/commands/setup-util-tealdeer @@ -21,7 +21,7 @@ function setup_util_tealdeer() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists tldr; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists tldr; then return 0 fi diff --git a/commands/setup-util-teip b/commands/setup-util-teip index a674ca14d..d9cd5fa17 100755 --- a/commands/setup-util-teip +++ b/commands/setup-util-teip @@ -25,7 +25,7 @@ function setup_util_teip() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists teip; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists teip; then return 0 fi diff --git a/commands/setup-util-tokei b/commands/setup-util-tokei index 22caf6321..1e05f0ac8 100755 --- a/commands/setup-util-tokei +++ b/commands/setup-util-tokei @@ -30,7 +30,7 @@ function setup_util_tokei() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists tokei; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists tokei; then return 0 fi diff --git a/commands/setup-util-trash b/commands/setup-util-trash index c15cd5477..24af2f5be 100755 --- a/commands/setup-util-trash +++ b/commands/setup-util-trash @@ -17,7 +17,7 @@ function setup_util_trash() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists trash; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists trash; then return 0 fi diff --git a/commands/setup-util-trunk b/commands/setup-util-trunk index 349302e20..fbcbba6e6 100755 --- a/commands/setup-util-trunk +++ b/commands/setup-util-trunk @@ -7,7 +7,7 @@ function setup_util_trunk() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists trunk; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists trunk; then return 0 fi diff --git a/commands/setup-util-vhs b/commands/setup-util-vhs index f3b6709d1..27576d3a7 100755 --- a/commands/setup-util-vhs +++ b/commands/setup-util-vhs @@ -42,7 +42,7 @@ function setup_util_vhs() ( e "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists vhs; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists vhs; then return 0 fi diff --git a/commands/setup-util-vim b/commands/setup-util-vim index 0c3ddda51..9b972d192 100755 --- a/commands/setup-util-vim +++ b/commands/setup-util-vim @@ -11,7 +11,7 @@ function setup_util_vim() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists vim; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists vim; then return 0 fi diff --git a/commands/setup-util-vnc b/commands/setup-util-vnc index dafdf005c..1b2c10411 100755 --- a/commands/setup-util-vnc +++ b/commands/setup-util-vnc @@ -19,7 +19,7 @@ function setup_util_vnc() ( fi # improve performance - if test "$*" = '--quiet' && command-exists grdctl; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists grdctl; then return 0 fi diff --git a/commands/setup-util-warp b/commands/setup-util-warp index 9030e37c2..129a9153d 100755 --- a/commands/setup-util-warp +++ b/commands/setup-util-warp @@ -14,7 +14,7 @@ function setup_util_warp() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists warp-cli; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists warp-cli; then return 0 fi diff --git a/commands/setup-util-wget b/commands/setup-util-wget index d3e4e659c..a8d3503bc 100755 --- a/commands/setup-util-wget +++ b/commands/setup-util-wget @@ -9,7 +9,7 @@ function setup_util_wget() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists wget; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists wget; then return 0 fi diff --git a/commands/setup-util-zoxide b/commands/setup-util-zoxide index f096c191c..e11f23d05 100755 --- a/commands/setup-util-zoxide +++ b/commands/setup-util-zoxide @@ -24,7 +24,7 @@ function setup_util_zoxide() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists zoxide; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists zoxide; then return 0 fi diff --git a/commands/setup-util-zsh b/commands/setup-util-zsh index f546c276e..bdda3a7bb 100755 --- a/commands/setup-util-zsh +++ b/commands/setup-util-zsh @@ -11,7 +11,7 @@ function setup_util_zsh() ( source "$DOROTHY/sources/bash.bash" # improve performance - if test "$*" = '--quiet' && command-exists zsh; then + if is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists zsh; then return 0 fi