TW-1587: Further improve example on-exit hook

- Initial patch was not quite right.  on-exit _does_ receive added and
  modified tasks on STDIN, but is not allowed to return JSON.
This commit is contained in:
Wilhelm Schuermann 2015-03-31 07:08:53 +02:00
parent c27f5d23b6
commit df209b9b8b
2 changed files with 12 additions and 3 deletions

View file

@ -5,9 +5,16 @@
# Output:
# - Optional feedback/error.
echo 'on-exit'
n=0
while read modified_task
do
n=$(($n + 1))
done
echo "on-exit: Counted $n added/modified tasks."
# Status:
# - 0: JSON ignored, non-JSON is feedback.
# - non-0: JSON ignored, non-JSON is error.
# - 0: Non-JSON is feedback.
# - non-0: Non-JSON is error.
exit 0