Skip to content

Instantly share code, notes, and snippets.

@antonagestam
Last active December 11, 2015 07:19
Show Gist options
  • Save antonagestam/4565712 to your computer and use it in GitHub Desktop.
Save antonagestam/4565712 to your computer and use it in GitHub Desktop.
Shell script that runs `workon project_name` when entering the project directory
function f(){
if [[ $VIRTUAL_ENV != /Users/anton/.virtualenvs/fundedbyme ]];
then
workon fundedbyme
fi
cdvirtualenv
}
function r(){
f
foreman start
}
function cd()
{
builtin cd $@
if [[ $PWD == /Users/anton/.virtualenvs/fundedbyme ]] || [[ $PWD == /Users/anton/.virtualenvs/fundedbyme/* ]];
then
if [[ $VIRTUAL_ENV != /Users/anton/.virtualenvs/fundedbyme ]];
then
workon fundedbyme
fi
fi
}
cd .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment