From 4f8f16e018f5eefc207d8bc59422fb2145595588 Mon Sep 17 00:00:00 2001 From: typebrook Date: Sat, 9 Nov 2019 23:47:28 +0800 Subject: update --- alias.sh | 2 +- scripts/check_upstream.sh | 36 ++++++++++++++++++------------------ scripts/sync.sh | 3 --- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/alias.sh b/alias.sh index d6b493e..787c8c5 100644 --- a/alias.sh +++ b/alias.sh @@ -100,7 +100,7 @@ alias t='tig' alias ts='tig status' alias ta='tig --all' alias get-tig='curl -LO https://github.com/typebrook/tig/releases/download/tig-2.4.1/tig' -alias upload-tig="$SETTING_DIR/scripts/upload-github-release-asset.sh github_api_token=$(head -1 $SETTING_DIR/tokens/github-release) owner=typebrook repo=tig tag=tig-2.4.1 filename=$(which tig)" +#alias upload-tig="$SETTING_DIR/scripts/upload-github-release-asset.sh github_api_token=$(head -1 $SETTING_DIR/tokens/github-release) owner=typebrook repo=tig tag=tig-2.4.1 filename=$(which tig)" # Android alias debug='./gradlew app:installDebug && adb shell am start -n com.geothings.geobingan/.MainActivity_' 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