diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2023-06-06 07:36:34 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2023-06-06 07:36:34 +0800 |
commit | 74da533ad8e848d2ad3ea08acc1de6d193baeb12 (patch) | |
tree | 2c6aaf1a15f96e942cd9298ac71ff194ac1beca7 /bin/init/sync.sh | |
parent | 4418f22aac80af84112ea7507480540e20c74385 (diff) |
Update sync check
Diffstat (limited to 'bin/init/sync.sh')
-rwxr-xr-x | bin/init/sync.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/init/sync.sh b/bin/init/sync.sh index 351bb74..413256a 100755 --- a/bin/init/sync.sh +++ b/bin/init/sync.sh | |||
@@ -3,7 +3,11 @@ | |||
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 >/dev/null && exit 0 | 4 | pidof git >/dev/null && exit 0 |
5 | 5 | ||
6 | # my repo | 6 | # Print information about ~/.wakeup |
7 | echo 'latest: ' $(date -d @`stat -c %Y ~/.wakeup` --iso-8601=minutes) | ||
8 | echo 'wakeup at: ' $(cat ~/.wakeup | xargs -i date -d @{} --iso-8601=minutes) | ||
9 | |||
10 | # Sync a repo | ||
7 | sync() { | 11 | sync() { |
8 | cd "$1" || return | 12 | cd "$1" || return |
9 | [ -z "$(git remote -v)" ] && return | 13 | [ -z "$(git remote -v)" ] && return |
@@ -13,6 +17,7 @@ sync() { | |||
13 | echo "Has trouble when syncing $(pwd)" | 17 | echo "Has trouble when syncing $(pwd)" |
14 | } | 18 | } |
15 | 19 | ||
20 | # Read file ~/.repos, and sync | ||
16 | sed /^#/d ~/.repos | while read -r repo; do | 21 | sed /^#/d ~/.repos | while read -r repo; do |
17 | eval "sync $repo &" | 22 | eval "sync $repo &" |
18 | done | 23 | done |
@@ -28,5 +33,6 @@ done | |||
28 | 33 | ||
29 | touch ~/.wakeup | 34 | touch ~/.wakeup |
30 | 35 | ||
36 | |||
31 | # others repo | 37 | # others repo |
32 | #check_upstream ~/git/tig || echo in `pwd` >/dev/tty & | 38 | #check_upstream ~/git/tig || echo in `pwd` >/dev/tty & |