Last active
August 11, 2016 13:34
-
-
Save rodfersou/be6e540ae8d08de82ea3d0ef39b9279f to your computer and use it in GitHub Desktop.
Alias to easily move into Plone project
This file contains 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
# 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