mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Hooks
- Cleaned up on-add.the example hook; now works with huge input without falling over.
This commit is contained in:
parent
1fa4c8ff7b
commit
ffc456be88
1 changed files with 2 additions and 9 deletions
|
@ -2,18 +2,11 @@
|
|||
|
||||
read new_task
|
||||
|
||||
re='(.*)([Tt])eh(.*)'
|
||||
if [[ $new_task =~ $re ]]
|
||||
if (echo $new_task | grep -qE '[tT]eh');
|
||||
then
|
||||
while [[ $new_task =~ $re ]]
|
||||
do
|
||||
new_task=${BASH_REMATCH[1]}${BASH_REMATCH[2]}he${BASH_REMATCH[3]}
|
||||
done
|
||||
|
||||
new_task=$(echo $new_task | sed -r 's/([tT])eh/\1he/g')
|
||||
echo "Auto-corrected 'teh' --> 'the'"
|
||||
fi
|
||||
|
||||
echo $new_task
|
||||
exit 0
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue