Created
February 3, 2017 12:16
-
-
Save JsseL/1523c8ba92b59680d023da523d50c1fa to your computer and use it in GitHub Desktop.
Work On
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
source ~/.bash_completion.d/wo | |
wo() { | |
cd /var/www/$1 | |
. ./venv/bin/activate | |
if [ -d project ]; then | |
cd project | |
fi | |
if [ -d app ]; then | |
cd app | |
fi | |
} |
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
_wo() | |
{ | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
COMPREPLY=( $(compgen -W "$(for i in $(ls -d1 /var/www/*/); do basename $i; done)" -- $cur) ) | |
} | |
complete -F _wo wo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment