|
@@ -1,3 +1,26 @@
|
1
|
1
|
#!/usr/bin/env bash
|
|
2
|
+#
|
|
3
|
+# firstpush
|
|
4
|
+#
|
|
5
|
+# Push a branch to 'origin' and open the
|
|
6
|
+# commit log to watch Travis CI progress.
|
|
7
|
+#
|
2
|
8
|
|
3
|
|
-git push --set-upstream origin `git branch | grep \* | sed 's/\* //g'`
|
|
9
|
+MFINFO=$(mfinfo) || exit
|
|
10
|
+IFS=' ' read -a INFO <<< "$MFINFO"
|
|
11
|
+FORK=${INFO[1]}
|
|
12
|
+REPO=${INFO[2]}
|
|
13
|
+BRANCH=${INFO[4]}
|
|
14
|
+
|
|
15
|
+git push --set-upstream origin $BRANCH
|
|
16
|
+
|
|
17
|
+TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }')
|
|
18
|
+URL="https://github.com/$FORK/$REPO/commits/$BRANCH"
|
|
19
|
+
|
|
20
|
+if [ -z "$TOOL" ]; then
|
|
21
|
+ echo "Can't find a tool to open the URL:"
|
|
22
|
+ echo $URL
|
|
23
|
+else
|
|
24
|
+ echo "Viewing commits on $BRANCH..."
|
|
25
|
+ "$TOOL" "$URL"
|
|
26
|
+fi
|