Use set -e
This commit is contained in:
parent
a91adf9c80
commit
23fa204e69
11
dunstctl
11
dunstctl
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -u
|
set -eu
|
||||||
|
|
||||||
DBUS_NAME="org.freedesktop.Notifications"
|
DBUS_NAME="org.freedesktop.Notifications"
|
||||||
DBUS_PATH="/org/freedesktop/Notifications"
|
DBUS_PATH="/org/freedesktop/Notifications"
|
||||||
@ -28,13 +28,8 @@ show_help() {
|
|||||||
EOH
|
EOH
|
||||||
}
|
}
|
||||||
dbus_send_checked() {
|
dbus_send_checked() {
|
||||||
dbus-send "$@"
|
dbus-send "$@" \
|
||||||
rc="$?"
|
|| die "Failed to communicate with dunst, is it running? Or maybe the version is outdated. You can try 'dunstctl debug' as a next debugging step."
|
||||||
if [ "$rc" -eq "1" ]; then
|
|
||||||
echo "Failed to communicate with dunst, is it running? Or maybe the version is outdated." >&2
|
|
||||||
echo "Hint: You can try 'dunstctl debug' as a next debugging step." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
method_call() {
|
method_call() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user