Skip to content

Instantly share code, notes, and snippets.

@spulec
Created January 6, 2014 16:36
Show Gist options
  • Save spulec/8285482 to your computer and use it in GitHub Desktop.
Save spulec/8285482 to your computer and use it in GitHub Desktop.
Auto activate virtualenvs in new terminal windows.
# If we are in a Development folder, we're probably in a virtual env. Try to activate it based on our CWD.
IN=$PWD
if [[ "$IN" == */Development/* ]]
then
arrIN=(${IN//// })
# This assumes Development is the third token and your project directory is the fourth
workon ${arrIN[3]}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment