Hooks
- Removed the ability for hooks to add tasks, or modify tasks that are outside the context of the current event. This makes hooks a local mechanism that operates only on local changes. Modifications/additions coming in via sync command are not processed by hooks.
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# The on-add event is triggered separately for each task added
|
||||
# The on-add event is triggered separately for each task added. This hook
|
||||
# script can accept/reject the addition. Processing will continue.
|
||||
|
||||
# Input:
|
||||
# - line of JSON for the task added
|
||||
|
||||
# Output:
|
||||
# - all emitted JSON lines are added/modified as tasks, if the exit code is
|
||||
# zero, otherwise ignored.
|
||||
# - minimal new task: {"description":"Buy milk"}
|
||||
# - to modify a task include complete JSON
|
||||
# - all emitted non-JSON lines are considered feedback messages if the exit
|
||||
# code is zero, otherwise they are considered errors.
|
||||
|
||||
# - Line of JSON for proposed new task.
|
||||
read new_task
|
||||
|
||||
# Output:
|
||||
# - JSON, modified or unmodified.
|
||||
# - Optional feedback/error.
|
||||
echo $new_task
|
||||
echo 'on-add'
|
||||
|
||||
# Status:
|
||||
# - 0: JSON accepted, non-JSON is feedback.
|
||||
# - non-0: JSON ignored, non-JSON is error.
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user