Last active
December 11, 2015 07:19
-
-
Save antonagestam/4565712 to your computer and use it in GitHub Desktop.
Shell script that runs `workon project_name` when entering the project directory
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
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