Skip to content

Instantly share code, notes, and snippets.

@jsonUK
Forked from westonruter/svnurl.sh
Created November 23, 2012 15:44
Show Gist options
  • Save jsonUK/4136191 to your computer and use it in GitHub Desktop.
Save jsonUK/4136191 to your computer and use it in GitHub Desktop.
Echo and pbcopy the URL for the given SVN working copy
#!/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}'`
echo $url | tr -d '\n' | pbcopy
echo $url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment