Skip to content

Instantly share code, notes, and snippets.

@rodfersou
Last active August 11, 2016 13:34
Show Gist options
  • Save rodfersou/be6e540ae8d08de82ea3d0ef39b9279f to your computer and use it in GitHub Desktop.
Save rodfersou/be6e540ae8d08de82ea3d0ef39b9279f to your computer and use it in GitHub Desktop.
Alias to easily move into Plone project
# go to git root directory
alias cdr='gitroot=`git rev-parse --show-toplevel`; cd $gitroot'
# go to git project directory
alias cdp='cdr; giturl=`git config --get remote.origin.url`; folder=${${${giturl##*/}%.*}//.//}; if [ -d "$folder" ]; then cd "$folder"; elif [ -d "src/$folder" ]; then cd "src/$folder"; fi'
# go to omelette directory
alias cdo='cdr; om1=parts/packages; om2=parts/omelette; if [ -d "$om1" ]; then cd "$om1"; elif [ -d "$om2" ]; then cd "$om2"; fi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment