use error()

This commit is contained in:
James Barnett
2017-05-31 12:54:19 -04:00
parent ccfb4c1209
commit 789de29893

View File

@@ -41,7 +41,7 @@ die() {
} }
traperror() { traperror() {
out "==> ERROR: Exited due to error on line" $1 error "Exited due to error on line $1"
out "exit status:" "$2" out "exit status:" "$2"
out "command:" "$3" out "command:" "$3"
out "bash line:" "$4" out "bash line:" "$4"
@@ -58,6 +58,9 @@ trapkill() {
trap 'traperror ${LINENO} $? "$BASH_COMMAND" $BASH_LINENO "${FUNCNAME[@]}"' ERR trap 'traperror ${LINENO} $? "$BASH_COMMAND" $BASH_LINENO "${FUNCNAME[@]}"' ERR
trap trapkill SIGTERM SIGINT trap trapkill SIGTERM SIGINT
echo foo | grep bar
notify_info() { notify_info() {
for u in $(users); do for u in $(users); do
sudo -u $u DISPLAY=:0 \ sudo -u $u DISPLAY=:0 \