aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/init
diff options
context:
space:
mode:
authorHsieh Chin Fan <typebrook@gmail.com>2022-04-18 13:49:18 +0800
committerHsieh Chin Fan <typebrook@gmail.com>2022-04-18 13:49:18 +0800
commitada2b183fdbe0abcad45d8c37f012c20dbb6d692 (patch)
tree2a3457314454fc6ffea575e28c4a11ea4ef168bf /tools/init
parent5cf916480f3a1a65a2e5be4e47839fa91998e719 (diff)
Update
Diffstat (limited to 'tools/init')
-rwxr-xr-xtools/init/sync.sh10
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 4pidof git >/dev/null && exit 0
5 5
6# my repo 6# my repo
7sync() { 7sync() {
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}
11sync $SETTING_DIR & 11sync $SETTING_DIR &
12sync ~/blog & 12sync ~/blog &
@@ -15,6 +15,12 @@ sync ~/.task &
15sync ~/.password-store & 15sync ~/.password-store &
16sync ~/.vim_runtime & 16sync ~/.vim_runtime &
17 17
18while [ $(jobs -r | wc -l) -gt 0 ]; do
19 sleep 1;
20done
21
22notify-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