taskwarrior/test/test_hooks/on-add-misbehave3
Paul Beckingham 3ff42af9c7 Unit Tests
- Added sample hooks that behave/misbehave in various ways.
2015-01-31 18:34:25 -05:00

20 lines
483 B
Bash

#!/bin/bash
# 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 proposed new task.
read new_task
# Output:
# - JSON, modified or unmodified.
# - Optional feedback/error.
echo $new_task
echo '{"description":"extra","status":"pending"}'
echo 'FEEDBACK'
# Status:
# - 0: JSON accepted, non-JSON is feedback.
# - non-0: JSON ignored, non-JSON is error.
exit 0