Skip to content

Instantly share code, notes, and snippets.

@JsseL
Created February 3, 2017 12:16
Show Gist options
  • Save JsseL/1523c8ba92b59680d023da523d50c1fa to your computer and use it in GitHub Desktop.
Save JsseL/1523c8ba92b59680d023da523d50c1fa to your computer and use it in GitHub Desktop.
Work On
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
}
_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