commit b7791ae96739ef78a4e26611e5d0110966e6941a
parent 8aede9331b39404dc728a3b9d5261383061422db
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 10 Jun 2020 09:43:53 +0200
Abort plumb on child process error and forward exit status to parent
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/.local/bin/plumb b/.local/bin/plumb
@@ -104,7 +104,7 @@ handle_calendar_invite() {
>> "$calendar"
rsync "$calendar" adamsgaard.dk:~/.calendar
upload "$calendar" >/dev/null;;
- *) exit;;
+ *) ;;
esac
}
@@ -232,6 +232,13 @@ handle_target() {
die "unknown target type: $t"
fi
fi
+ s="$?"
+ if [ "$s" -ne 0 ]; then
+ if [ "$verbose" = 1 ]; then
+ echo "child process error"
+ fi
+ exit "$s"
+ fi
}
verbose=0