You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
663 B
Plaintext
31 lines
663 B
Plaintext
9 years ago
|
#!/usr/bin/env bash
|
||
8 years ago
|
#
|
||
|
# firstpush
|
||
|
#
|
||
|
# Push a branch to 'origin' and open the
|
||
|
# commit log to watch Travis CI progress.
|
||
|
#
|
||
9 years ago
|
|
||
6 years ago
|
[[ $# == 0 ]] || { echo "usage: `basename $0`" 1>&2 ; exit 1; }
|
||
7 years ago
|
|
||
|
MFINFO=$(mfinfo) || exit 1
|
||
8 years ago
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
||
|
FORK=${INFO[1]}
|
||
|
REPO=${INFO[2]}
|
||
7 years ago
|
BRANCH=${INFO[5]}
|
||
8 years ago
|
|
||
|
git push --set-upstream origin $BRANCH
|
||
|
|
||
5 years ago
|
which xdg-open >/dev/null && TOOL=xdg-open
|
||
|
which gnome-open >/dev/null && TOOL=gnome-open
|
||
|
which open >/dev/null && TOOL=open
|
||
8 years ago
|
URL="https://github.com/$FORK/$REPO/commits/$BRANCH"
|
||
|
|
||
5 years ago
|
if [ -z "$OPEN" ]; then
|
||
8 years ago
|
echo "Can't find a tool to open the URL:"
|
||
|
echo $URL
|
||
|
else
|
||
|
echo "Viewing commits on $BRANCH..."
|
||
5 years ago
|
"$OPEN" "$URL"
|
||
8 years ago
|
fi
|