Skip to content

Instantly share code, notes, and snippets.

View ajpen's full-sized avatar

Anfernee Jervis ajpen

View GitHub Profile
@ajpen
ajpen / virtualenv-auto-activate.sh
Last active May 7, 2018 16:14 — forked from Willyfrog/virtualenv-auto-activate.sh
virtualenv-auto-activate-auto-deactivate with support for existing custom PROMPT_COMMAND
#!/bin/bash
_virtualenv_auto_activate() {
if [ -e ".env" ]; then
# Check to see if already activated to avoid redundant activating
if [ "$VIRTUAL_ENV" = "" ]; then
source .env/bin/activate
fi
else
if [ "$VIRTUAL_ENV" != "" ]; then