forked from bater/taiwan_love_wins
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsign.sh
More file actions
executable file
·29 lines (23 loc) · 749 Bytes
/
Copy pathsign.sh
File metadata and controls
executable file
·29 lines (23 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# uncomment this for debug
# set -o xtrace
# This is a file use to sign. Please input file as parameter.
# Usage: ./sign.sh signed_by_${USERNAME}.md
pushd $(dirname $0)
REPO=$(cat .git/config | grep "git@github.com" | cut -f 2 -d ':' | sed s/\.git//)
git pull
git remote add upstream https://github.com/RainbowEngineer/taiwan_love_wins.git 2> /dev/null
git fetch upstream
git merge upstream/master
git push
git add $1
git commit
git push
if [ -f $(which hub) ]; then
echo '自動送 pull-request...'
hub pull-request -m "Please add my sign!!" -b RainbowEngineer/taiwan_love_wins:master
else
echo '系統沒有安裝hub,請前往以下網址送出pull request:'
echo "https://github.com/${REPO}/pull/new/master"
fi
popd