Created
August 18, 2011 18:48
-
-
Save westonruter/1154817 to your computer and use it in GitHub Desktop.
Echo and pbcopy the URL for the given SVN working copy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Prints and copies to the clipboard the SVN URL of the current working | |
# directory or the first command line argument | |
# by @westonruter; use of awk and tr thanks to @josh_wnj | |
if [ $# == 0 ]; then | |
cwd=`pwd` | |
else | |
cwd="$1" | |
fi | |
url=`svn info $cwd | grep 'URL:' | awk '{print $2}' | tr -d '\n'` | |
echo $url | pbcopy | |
echo $url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment