From 4f8f16e018f5eefc207d8bc59422fb2145595588 Mon Sep 17 00:00:00 2001 From: typebrook Date: Sat, 9 Nov 2019 23:47:28 +0800 Subject: update --- scripts/check_upstream.sh | 36 ++++++++++++++++++------------------ scripts/sync.sh | 3 --- 2 files changed, 18 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/check_upstream.sh b/scripts/check_upstream.sh index c08b3cf..9f20037 100755 --- a/scripts/check_upstream.sh +++ b/scripts/check_upstream.sh @@ -1,27 +1,27 @@ +#! /bin/bash + # This script is for repo forked from others # check $1(repo) if upstream branch origin/master is # ahead of local branch $2(default to dev) -check_upstream() { - if [ ! -d $1 ]; then - return 0 - fi +if [ ! -d $1 ]; then + return 0 +fi - head='dev' - if [ $# -eq 2 ] - then - head=$2 - fi +head='dev' +if [ $# -eq 2 ] +then + head=$2 +fi - cd $1 - git fetch origin && \ - git rev-list $head | grep $(git rev-parse origin/master) > /dev/null +cd $1 +git fetch origin && \ +git rev-list $head | grep $(git rev-parse origin/master) > /dev/null - if [ $? -ne 0 ] - then - echo "New commit at" $1 - fi +if [ $? -ne 0 ] +then + echo "New commit at" $1 +fi - echo $(date) check $1 >> $SETTING_DIR/log -} +echo $(date) check $1 >> $SETTING_DIR/log diff --git a/scripts/sync.sh b/scripts/sync.sh index fa37fee..5591203 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -1,8 +1,5 @@ #!/bin/bash -DIR="$(cd "$(dirname "$0")" && pwd)" -source $DIR/check_upstream.sh - cd $SETTING_DIR && git pull --quiet & cd ~/vimwiki && git pull --quiet & check_upstream ~/git/tig & -- cgit v1.2.3-70-g09d2