Patch up OPEN command in git scripts
This commit is contained in:
@ -23,15 +23,17 @@ OLDBRANCH=${INFO[5]}
|
||||
# See if it's been pushed yet
|
||||
if [ -z "$(git branch -vv | grep ^\* | grep \\[origin)" ]; then firstpush; fi
|
||||
|
||||
TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }')
|
||||
which xdg-open >/dev/null && TOOL=xdg-open
|
||||
which gnome-open >/dev/null && TOOL=gnome-open
|
||||
which open >/dev/null && TOOL=open
|
||||
URL="https://github.com/$ORG/$REPO/compare/$TARG...$FORK:$BRANCH?expand=1"
|
||||
|
||||
if [ -z "$TOOL" ]; then
|
||||
if [ -z "$OPEN" ]; then
|
||||
echo "Can't find a tool to open the URL:"
|
||||
echo $URL
|
||||
else
|
||||
echo "Opening a New PR Form..."
|
||||
"$TOOL" "$URL"
|
||||
"$OPEN" "$URL"
|
||||
fi
|
||||
|
||||
[[ $BRANCH != $OLDBRANCH ]] && git checkout $OLDBRANCH
|
||||
|
Reference in New Issue
Block a user