taskwarrior/scripts/hooks
Dustin J. Mitchell 03ec490913
Add shell quoting and 'read -r' in example hooks
This helps to avoid interpretation of escape sequences, such as
backslash-escapes, in these values.

Patch provided by @bughunter2 in https://github.com/GothenburgBitFactory/taskwarrior/issues/3899.
2025-06-23 16:35:04 -04:00
..
on-add Add shell quoting and 'read -r' in example hooks 2025-06-23 16:35:04 -04:00
on-add.the Add shell quoting and 'read -r' in example hooks 2025-06-23 16:35:04 -04:00
on-exit Add shell quoting and 'read -r' in example hooks 2025-06-23 16:35:04 -04:00
on-exit.shadow-file Add shell quoting and 'read -r' in example hooks 2025-06-23 16:35:04 -04:00
on-launch add initial bulk run from pre-commit over all files 2024-07-29 22:34:51 +02:00
on-modify Add shell quoting and 'read -r' in example hooks 2025-06-23 16:35:04 -04:00
README add initial bulk run from pre-commit over all files 2024-07-29 22:34:51 +02:00

Example Hook Scripts

Hooks are supported in Taskwarrior 2.4.0 and later. Hooks require no
configuration, and simply need to exist, in the expected location, with the
expected name, with execute permission. If these conditions are met, the hook
scripts will be run.

Expected Location
  The hooks scripts all reside in one location, which is in a 'hooks'
  subdirectory, in your ~/.task (or rc.data.location override) directory.
  You can use the command `task diagnostics` to verify hooks location.

Expected Name
  A hook scripts must be named according to which event triggers the script. A
  script named 'on-add' will be triggered by a task add event. Multiple hook
  scripts can coexist, and will all be run, in collating sequence. If there are
  two scripts, named 'on-add-check-for-missing-priority' and 'on-add.x', they
  are both executed, in the order shown here.

Expected Permissions
  A hook script must have execute permission for the user running taskwarrior,
  otherwise it is skipped.

Interface
  Each hook script has a unique interface. This is documented in the example
  scripts here.