taskwarrior/test/test_hooks/on-modify-revert
Dustin J. Mitchell 68cf122cea
Update hooks to use read -r and printf
This portably avoids any interpretation of backslash escapes by the
shell.
2025-07-02 15:36:43 -04:00

20 lines
542 B
Bash
Executable file

#!/bin/sh
# The on-modify event is triggered separately for each task modified. This hook
# script can accept/reject the modification. Processing will continue.
# Input:
# - line of JSON for the original task
# - line of JSON for the modified task, the diff being the modification
read -r original_task
read -r modified_task
# Output:
# - JSON, modified or unmodified.
# - Optional feedback/error.
printf "%s\n" "$original_task"
# Status:
# - 0: JSON accepted, non-JSON is feedback.
# - non-0: JSON ignored, non-JSON is error.
exit 0