diff --git a/default.conf.yaml b/default.conf.yaml index 045a1cc..ea66899 100644 --- a/default.conf.yaml +++ b/default.conf.yaml @@ -1,6 +1,7 @@ - shell: - mkdir -p ~/.config - mkdir -p ~/.config/direnv + - mkdir -p ~/.task - clean: ['~', '~/.config'] @@ -19,6 +20,7 @@ ~/.gitignore: git/gitignore ~/.my.cnf: mysql/.my.cnf ~/.psqlrc: psql/.psqlrc + ~/.task/hooks: task/hooks/ ~/.taskrc: task/.taskrc ~/.tmux.conf: tmux/.tmux.conf ~/.vimrc: vim/.vimrc diff --git a/task/hooks/on-exit-sync.sh b/task/hooks/on-exit-sync.sh new file mode 100755 index 0000000..50455ca --- /dev/null +++ b/task/hooks/on-exit-sync.sh @@ -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