summaryrefslogtreecommitdiffstats
path: root/.local/bin/ifinstalled
diff options
context:
space:
mode:
authorkrisdoodle45 <86745210+krisdoodle45@users.noreply.github.com>2022-02-17 18:13:14 +0100
committerGitHub <noreply@github.com>2022-02-17 18:13:14 +0100
commitc16d6fd3b04670b2ae1315cfbc5dd6b53d44d0c5 (patch)
tree21b640553e5efd77b05cb63dbb30496867ce224d /.local/bin/ifinstalled
parent9ad912fe4eaf8c1b9c844780829aaea693c1e6de (diff)
parent82b70e3a8e3aed45998c38024e8c3e16f9680cff (diff)
downloadeibhear-c16d6fd3b04670b2ae1315cfbc5dd6b53d44d0c5.tar.gz
eibhear-c16d6fd3b04670b2ae1315cfbc5dd6b53d44d0c5.tar.zst
eibhear-c16d6fd3b04670b2ae1315cfbc5dd6b53d44d0c5.zip
Merge branch 'LukeSmithxyz:master' into patch-4
Diffstat (limited to '.local/bin/ifinstalled')
-rwxr-xr-x.local/bin/ifinstalled9
1 files changed, 4 insertions, 5 deletions
diff --git a/.local/bin/ifinstalled b/.local/bin/ifinstalled
index 7a53b18..c192eba 100755
--- a/.local/bin/ifinstalled
+++ b/.local/bin/ifinstalled
@@ -5,9 +5,8 @@
# it informs the user that they need that command to continue. This is used in
# various other scripts for clarity's sake.
-for x in "$@";do
- notify() { notify-send "📦 $x" "must be installed for this function." && exit 1 ;}
- which_out="$( /usr/bin/which "$x" >/dev/null 2>&1 )" && exit 0 #you might have compiled the prog, and not install the repo pkg...
- pkgname="$(pacman -Qqo "$which_out" >/dev/null 2>&1 )" #...thats why two variables.
- pacman -Qq "$pkgname" >/dev/null 2>&1 || notify
+for x in "$@"; do
+ if ! which "$x" >/dev/null 2>&1 && ! pacman -Qq "$x" >/dev/null 2>&1; then
+ notify-send "📦 $x" "must be installed for this function." && exit 1 ;
+ fi
done