[137532] users/chunyang
chunyang at macports.org
chunyang at macports.org
Sat Jun 13 12:26:11 PDT 2015
Revision: 137532
https://trac.macports.org/changeset/137532
Author: chunyang at macports.org
Date: 2015-06-13 12:26:11 -0700 (Sat, 13 Jun 2015)
Log Message:
-----------
users/chunyang: svn-open: Initial commit
A small script to open svn repository URL in browser.
Added Paths:
-----------
users/chunyang/svn-open/
users/chunyang/svn-open/svn-open
Added: users/chunyang/svn-open/svn-open
===================================================================
--- users/chunyang/svn-open/svn-open (rev 0)
+++ users/chunyang/svn-open/svn-open 2015-06-13 19:26:11 UTC (rev 137532)
@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+# Open svn repository URL in browser (inspired by git open)
+#
+# Written by Chunyang Xu <chunyang at macports.org>
+#
+# Latest version can be found at
+# https://svn.macports.org/repository/macports/users/chunyang/svn-open
+#
+
+PROGNAME=$(basename "$0")
+REPO_URL=""
+
+function usage {
+ echo "Usage - $PROGNAME [-r | --root]"
+}
+
+function error_exit {
+ echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
+ exit 1
+}
+
+svn info &> /dev/null || error_exit "$(pwd) not registered"
+
+if [ $# -ne 0 ]; then
+ if [ "$1" == "-r" ] || [ "$1" == "--root" ]; then
+ REPO_URL=$( svn info | grep '^Repository Root'| awk '{print $NF}' )
+ else
+ usage
+ fi
+else
+ REPO_URL=$( svn info | grep '^URL'| awk '{print $NF}' )
+fi
+
+open "$REPO_URL"
Property changes on: users/chunyang/svn-open/svn-open
___________________________________________________________________
Added: svn:executable
+ *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150613/68b944ca/attachment.html>
More information about the macports-changes
mailing list