From 7fdac6a09ea242259456a60d6fbbcbbda676e7b6 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 8 Sep 2014 00:51:21 -0400 Subject: [PATCH] Hooks - Added an example hook script, on-exit.shadow-file, which simulates the now deprecated (soon to be removed) shadow file feature. --- scripts/hooks/on-exit.shadow-file | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/hooks/on-exit.shadow-file diff --git a/scripts/hooks/on-exit.shadow-file b/scripts/hooks/on-exit.shadow-file new file mode 100755 index 000000000..27b989a4f --- /dev/null +++ b/scripts/hooks/on-exit.shadow-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 +