mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
Hooks
- Added an example hook script, on-exit.shadow-file, which simulates the now deprecated (soon to be removed) shadow file feature.
This commit is contained in:
parent
6d36e7cd5b
commit
7fdac6a09e
1 changed files with 21 additions and 0 deletions
21
scripts/hooks/on-exit.shadow-file
Executable file
21
scripts/hooks/on-exit.shadow-file
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This hook script replaces the shadow file feature, found in Taskwarrior
|
||||
# prior to version 2.4.0.
|
||||
#
|
||||
# This script assumes that the legacy shadow file settings are still used.
|
||||
# Although those settings are now not recognized by Taskwarrior, іt is
|
||||
# harmless to store configuration settings for extensions in .taskrc.
|
||||
|
||||
# The command to run, to generate the shadow file.
|
||||
SHADOW_COMMAND=$(task _get rc.shadow.command)
|
||||
|
||||
# The file to overwrite.
|
||||
SHADOW_FILE=$(task _get rc.shadow.file)
|
||||
|
||||
# Overwrite the shadow file by running the command.
|
||||
task $SHADOW_COMMAND > $SHADOW_FILE 2>/dev/null
|
||||
|
||||
echo Shadow file $SHADOW_FILE updated.
|
||||
exit 0
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue