task: Add hooks directory
This commit is contained in:
parent
18af397ed5
commit
61ca8110a0
2 changed files with 14 additions and 0 deletions
|
|
@ -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
12
task/hooks/on-exit-sync.sh
Executable 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue