mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
* Add test case to cover https://github.com/GothenburgBitFactory/taskwarrior/issues/3416 * Add (builtin) on-add-modify test hook and use it * TDB2::add() move hook invocation before save (#3416)
This commit is contained in:
parent
e4c33d1e1d
commit
fb16dbf7cf
3 changed files with 41 additions and 3 deletions
21
test/test_hooks/on-add-modify
Normal file
21
test/test_hooks/on-add-modify
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Input:
|
||||
# - Line of JSON for proposed new task.
|
||||
read new_task
|
||||
|
||||
if (echo $new_task | grep -qE '[tT]eh');
|
||||
then
|
||||
new_task=$(echo $new_task | sed -r 's/([tT])eh/\1he/g')
|
||||
fi
|
||||
|
||||
# Output:
|
||||
# - JSON, modified
|
||||
# - Optional feedback/error.
|
||||
echo $new_task
|
||||
echo 'FEEDBACK'
|
||||
|
||||
# Status:
|
||||
# - 0: JSON accepted, non-JSON is feedback.
|
||||
# - non-0: JSON ignored, non-JSON is error.
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue