[sh] Add wording argument to exist script

Added optional third argument to exist script which can be used to
identify the program or process that needs the command exist looks for.
This makes it easier to identify *who* called exist and is missing
something.
This commit is contained in:
Marty Oehme 2020-05-11 16:52:51 +02:00
parent 9e1bc94025
commit b7e13d649d
No known key found for this signature in database
GPG Key ID: 0CCB0526EFB9611A
1 changed files with 2 additions and 2 deletions

View File

@ -8,9 +8,9 @@ if command -v "$1" >/dev/null; then
else
if [ -n "$2" ]; then
if command -v notify-send >/dev/null; then
notify-send "📦 $1" --urgency="$2" "must be installed for this function."
notify-send "📦 $1" --urgency="$2" "must be installed for ${3:-"this"} function."
fi
printf "%s: 📦 %s must be installed for this function.\n" "$2" "$1"
printf "%s: 📦 %s must be installed for %s function.\n" "$2" "$1" "${3:-"this"}"
fi
exit 1
fi