[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:
parent
9e1bc94025
commit
b7e13d649d
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue