From 74da533ad8e848d2ad3ea08acc1de6d193baeb12 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 6 Jun 2023 07:36:34 +0800 Subject: Update sync check --- bin/init/sync.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bin/init/sync.sh') 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 @@ # If git is working in other process, then don't sync again pidof git >/dev/null && exit 0 -# my repo +# Print information about ~/.wakeup +echo 'latest: ' $(date -d @`stat -c %Y ~/.wakeup` --iso-8601=minutes) +echo 'wakeup at: ' $(cat ~/.wakeup | xargs -i date -d @{} --iso-8601=minutes) + +# Sync a repo sync() { cd "$1" || return [ -z "$(git remote -v)" ] && return @@ -13,6 +17,7 @@ sync() { echo "Has trouble when syncing $(pwd)" } +# Read file ~/.repos, and sync sed /^#/d ~/.repos | while read -r repo; do eval "sync $repo &" done @@ -28,5 +33,6 @@ done touch ~/.wakeup + # others repo #check_upstream ~/git/tig || echo in `pwd` >/dev/tty & -- cgit v1.2.3-70-g09d2