From 4cdf77a295bc62466a24c7a2aabd893b4bd09554 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 27 Apr 2023 17:13:50 +0800 Subject: Update --- bin/init/sync.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'bin/init') diff --git a/bin/init/sync.sh b/bin/init/sync.sh index ffd91c0..fb939e3 100755 --- a/bin/init/sync.sh +++ b/bin/init/sync.sh @@ -5,15 +5,16 @@ pidof git >/dev/null && exit 0 # my repo sync() { - { - cd $1 && [[ -n `git remote -v` ]] || return - } 2>/dev/null + cd "$1" || return + [ -z "$(git remote -v)" ] && return + + pwd GIT_SSH_COMMAND="ssh -o ControlMaster=no" git pull --quiet || echo Has trouble when syncing `pwd` } -while read repo; do - sync $repo & -done <~/.repos +sed /^#/d ~/.repos | while read -r repo; do + eval "sync $repo &" +done while true; do if test $(jobs -r | wc -l) -gt 0; then @@ -26,8 +27,3 @@ done & # others repo #check_upstream ~/git/tig || echo in `pwd` >/dev/tty & - -# thunderbird -#if [[ `cat /etc/hostname` != 'vultr' ]]; then -# rsync -a pham@topo.tw:~/.thunderbird/ ~/.thunderbird & -#fi -- cgit v1.2.3-70-g09d2