summaryrefslogtreecommitdiff
path: root/mac/.local/bin/ifinstalled
diff options
context:
space:
mode:
Diffstat (limited to 'mac/.local/bin/ifinstalled')
-rwxr-xr-xmac/.local/bin/ifinstalled7
1 files changed, 5 insertions, 2 deletions
diff --git a/mac/.local/bin/ifinstalled b/mac/.local/bin/ifinstalled
index d0bd26b..b48dd63 100755
--- a/mac/.local/bin/ifinstalled
+++ b/mac/.local/bin/ifinstalled
@@ -6,7 +6,10 @@
# various other scripts for clarity's sake.
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
+ if ! command -v "$x" >/dev/null 2>&1 &&
+ ! brew list --formula "$x" >/dev/null 2>&1 &&
+ ! brew list --cask "$x" >/dev/null 2>&1; then
+ osascript -e 'display notification "'"$x"' must be installed for this function." with title "📦 Dependency missing"'
+ exit 1
fi
done