diff options
| author | Hsieh Chin Fan <typebrook@gmail.com> | 2022-04-18 13:49:18 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <typebrook@gmail.com> | 2022-04-18 13:49:18 +0800 |
| commit | ada2b183fdbe0abcad45d8c37f012c20dbb6d692 (patch) | |
| tree | 2a3457314454fc6ffea575e28c4a11ea4ef168bf /tools/init | |
| parent | 5cf916480f3a1a65a2e5be4e47839fa91998e719 (diff) | |
Update
Diffstat (limited to 'tools/init')
| -rwxr-xr-x | tools/init/sync.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/init/sync.sh b/tools/init/sync.sh index 15663f0..6dd57ba 100755 --- a/tools/init/sync.sh +++ b/tools/init/sync.sh | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | # If git is working in other process, then don't sync again | 3 | # If git is working in other process, then don't sync again |
| 4 | ! pidof git && exit 0 | 4 | pidof git >/dev/null && exit 0 |
| 5 | 5 | ||
| 6 | # my repo | 6 | # my repo |
| 7 | sync() { | 7 | sync() { |
| 8 | { cd $1 && [[ -n $(git remote -v) ]] || return; } 2>/dev/null | 8 | { cd $1 && [[ -n $(git remote -v) ]] || return; } 2>/dev/null |
| 9 | git pull --quiet || echo in `pwd` >/dev/tty | 9 | git pull --quiet || echo Has trouble when syncing `pwd` >/dev/tty |
| 10 | } | 10 | } |
| 11 | sync $SETTING_DIR & | 11 | sync $SETTING_DIR & |
| 12 | sync ~/blog & | 12 | sync ~/blog & |
| @@ -15,6 +15,12 @@ sync ~/.task & | |||
| 15 | sync ~/.password-store & | 15 | sync ~/.password-store & |
| 16 | sync ~/.vim_runtime & | 16 | sync ~/.vim_runtime & |
| 17 | 17 | ||
| 18 | while [ $(jobs -r | wc -l) -gt 0 ]; do | ||
| 19 | sleep 1; | ||
| 20 | done | ||
| 21 | |||
| 22 | notify-send 'Repos synced' | ||
| 23 | |||
| 18 | # others repo | 24 | # others repo |
| 19 | #check_upstream ~/git/tig || echo in `pwd` >/dev/tty & | 25 | #check_upstream ~/git/tig || echo in `pwd` >/dev/tty & |
| 20 | 26 | ||