Skip to content

Instantly share code, notes, and snippets.

@benclark
Created June 1, 2013 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benclark/5688972 to your computer and use it in GitHub Desktop.
Save benclark/5688972 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# this script should not be run directly,
# instead you need to source it from your .bashrc,
# by adding this line:
# . PATH_TO_SCRIPT/goto_repo.sh
function repo() {
reponame=$1
basedir="$HOME/Sites/$reponame"
if [ -d "$basedir/repo" ]; then
cd "$basedir/repo"
elif [ -d "$basedir/trunk" ]; then
cd "$basedir/trunk"
elif [ -d "$basedir" ]; then
cd "$basedir"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment