taskwarrior/test/test_hooks/on-add-misbehave6
Paul Beckingham 8b28c36485 Unit Tests
- Modified the test_hooks/* scripts to use /bin/sh, which is portable. When
  using /bin/bash, Cygwin and FreeBSD silently fail.
2015-02-07 10:22:07 -05:00

19 lines
449 B
Bash

#!/bin/sh
# 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 '{"description":"invalid"}'
echo 'FEEDBACK'
# Status:
# - 0: JSON accepted, non-JSON is feedback.
# - non-0: JSON ignored, non-JSON is error.
exit 0