mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
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:
parent
c27f5d23b6
commit
df209b9b8b
2 changed files with 12 additions and 3 deletions
|
@ -8,6 +8,8 @@
|
||||||
to Ulf Eliasson).
|
to Ulf Eliasson).
|
||||||
- TW-1583 Invalid ID displayed for first report after done/delete (thanks to
|
- TW-1583 Invalid ID displayed for first report after done/delete (thanks to
|
||||||
Ulf Eliasson).
|
Ulf Eliasson).
|
||||||
|
- TW-1587 Fix and improve example on-exit hook, adjust to new hooks API
|
||||||
|
(thanks to Jochen Sprickerhof).
|
||||||
- Setting 'bulk' to zero is interpreted as infinity, which means there is no
|
- Setting 'bulk' to zero is interpreted as infinity, which means there is no
|
||||||
amount of changes that is considered dangerous (thanks to Tomas Babej).
|
amount of changes that is considered dangerous (thanks to Tomas Babej).
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,16 @@
|
||||||
|
|
||||||
# Output:
|
# Output:
|
||||||
# - Optional feedback/error.
|
# - 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:
|
# Status:
|
||||||
# - 0: JSON ignored, non-JSON is feedback.
|
# - 0: Non-JSON is feedback.
|
||||||
# - non-0: JSON ignored, non-JSON is error.
|
# - non-0: Non-JSON is error.
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue