diff options
author | typebrook <typebrook@gmail.com> | 2020-02-17 08:42:44 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-02-17 08:42:44 +0800 |
commit | 0dd86f8d5cdef3e62d3f6fd35870f92fd71da883 (patch) | |
tree | 5a93cb36d21fea6766821fcc02203aa63b0c8a1a | |
parent | 3a1654819edf6492b6510e55a8b0b18871fcf37b (diff) |
update
-rwxr-xr-x | scripts/check_upstream | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/check_upstream b/scripts/check_upstream index e96a450..2c5fef0 100755 --- a/scripts/check_upstream +++ b/scripts/check_upstream | |||
@@ -4,7 +4,7 @@ | |||
4 | # check $1(repo) if upstream branch origin/master is | 4 | # check $1(repo) if upstream branch origin/master is |
5 | # ahead of local branch $2(default to dev) | 5 | # ahead of local branch $2(default to dev) |
6 | 6 | ||
7 | if [ ! -d $1 ]; then | 7 | if [ ! -d "$1" ]; then |
8 | return 0 | 8 | return 0 |
9 | fi | 9 | fi |
10 | 10 | ||
@@ -14,13 +14,12 @@ then | |||
14 | head=$2 | 14 | head=$2 |
15 | fi | 15 | fi |
16 | 16 | ||
17 | cd $1 | 17 | cd "$1" && \ |
18 | git pull my && \ | ||
18 | git fetch origin && \ | 19 | git fetch origin && \ |
19 | git rev-list $head | grep $(git rev-parse origin/master) > /dev/null | 20 | if git rev-list "$head" | grep "$(git rev-parse origin/master)" > /dev/null |
20 | |||
21 | if [ $? -ne 0 ] | ||
22 | then | 21 | then |
23 | echo "New commit at" $1 | 22 | echo "New commit at" "$1" |
24 | fi | 23 | fi |
25 | 24 | ||
26 | echo $(date) check $1 >> $SETTING_DIR/log | 25 | echo "$(date)" check "$1" >> "$SETTING_DIR/log" |