1
0
Fork 0

task: Add hooks directory

This commit is contained in:
Jeremy Kaplan 2020-02-08 19:59:53 -08:00
commit 61ca8110a0
2 changed files with 14 additions and 0 deletions

View file

@ -1,6 +1,7 @@
- shell: - shell:
- mkdir -p ~/.config - mkdir -p ~/.config
- mkdir -p ~/.config/direnv - mkdir -p ~/.config/direnv
- mkdir -p ~/.task
- clean: ['~', '~/.config'] - clean: ['~', '~/.config']
@ -19,6 +20,7 @@
~/.gitignore: git/gitignore ~/.gitignore: git/gitignore
~/.my.cnf: mysql/.my.cnf ~/.my.cnf: mysql/.my.cnf
~/.psqlrc: psql/.psqlrc ~/.psqlrc: psql/.psqlrc
~/.task/hooks: task/hooks/
~/.taskrc: task/.taskrc ~/.taskrc: task/.taskrc
~/.tmux.conf: tmux/.tmux.conf ~/.tmux.conf: tmux/.tmux.conf
~/.vimrc: vim/.vimrc ~/.vimrc: vim/.vimrc

12
task/hooks/on-exit-sync.sh Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
count=0
while read -r; do
count=$((count + 1))
done
if ((count > 0)); then
exec task sync | tee ~/.task/sync_hook.log
else
echo "No changes to sync"
fi