mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Hooks
- Added example hook scripts.
This commit is contained in:
parent
8c36392fb0
commit
3f2df5a3b6
5 changed files with 93 additions and 1 deletions
23
scripts/hooks/on-add
Executable file
23
scripts/hooks/on-add
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Input:
|
||||
# - New task JSON.
|
||||
read new_task
|
||||
|
||||
# Processing goes here.
|
||||
|
||||
# Output:
|
||||
# - Any line of JSON emitted is added as a new task.
|
||||
# - Any non-JSON emitted is displayed as a message.
|
||||
echo on-add
|
||||
|
||||
# Exit:
|
||||
# - 0 Means accept $new_task if JSON is not emitted.
|
||||
# - 0 Means accept all JSON as new tasks. If UUID matches $new_task, use this
|
||||
# JSON instead of $new_task. If UUID does not match $new_task, then these
|
||||
# are additional tasks.
|
||||
# - 0 Means all non-JSON becomes footnote entries.
|
||||
# - 1 Means all non-JSON becomes error entries.
|
||||
# - 1 Means reject $new_task.
|
||||
exit 0
|
||||
|
22
scripts/hooks/on-exit
Executable file
22
scripts/hooks/on-exit
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Input:
|
||||
# - None
|
||||
|
||||
# Processing goes here.
|
||||
|
||||
# Output:
|
||||
# - Any line of JSON emitted is added as a new task.
|
||||
# - Any non-JSON emitted is displayed as a message.
|
||||
echo on-exit
|
||||
|
||||
# Exit:
|
||||
# - 0 Means accept $new_task if JSON is not emitted.
|
||||
# - 0 Means accept all JSON as new tasks. If UUID matches $new_task, use this
|
||||
# JSON instead of $new_task. If UUID does not match $new_task, then these
|
||||
# are additional tasks.
|
||||
# - 0 Means all non-JSON becomes footnote entries.
|
||||
# - 1 Means all non-JSON becomes error entries.
|
||||
# - 1 Means reject $new_task.
|
||||
exit 0
|
||||
|
22
scripts/hooks/on-launch
Executable file
22
scripts/hooks/on-launch
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Input:
|
||||
# - None
|
||||
|
||||
# Processing goes here.
|
||||
|
||||
# Output:
|
||||
# - Any line of JSON emitted is added as a new task.
|
||||
# - Any non-JSON emitted is displayed as a message.
|
||||
echo on-launch
|
||||
|
||||
# Exit:
|
||||
# - 0 Means accept $new_task if JSON is not emitted.
|
||||
# - 0 Means accept all JSON as new tasks. If UUID matches $new_task, use this
|
||||
# JSON instead of $new_task. If UUID does not match $new_task, then these
|
||||
# are additional tasks.
|
||||
# - 0 Means all non-JSON becomes footnote entries.
|
||||
# - 1 Means all non-JSON becomes error entries.
|
||||
# - 1 Means reject $new_task.
|
||||
exit 0
|
||||
|
25
scripts/hooks/on-modify
Executable file
25
scripts/hooks/on-modify
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Input:
|
||||
# - Original task JSON
|
||||
# - Modified task JSON
|
||||
read original_task
|
||||
read modified_task
|
||||
|
||||
# Processing goes here.
|
||||
|
||||
# Output:
|
||||
# - Any line of JSON emitted is added as a new task.
|
||||
# - Any non-JSON emitted is displayed as a message.
|
||||
echo on-modify
|
||||
|
||||
# Exit:
|
||||
# - 0 Means accept $new_task if JSON is not emitted.
|
||||
# - 0 Means accept all JSON as new tasks. If UUID matches $new_task, use this
|
||||
# JSON instead of $new_task. If UUID does not match $new_task, then these
|
||||
# are additional tasks.
|
||||
# - 0 Means all non-JSON becomes footnote entries.
|
||||
# - 1 Means all non-JSON becomes error entries.
|
||||
# - 1 Means reject $new_task.
|
||||
exit 0
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue