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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user