Skip to content

Instantly share code, notes, and snippets.

@clneagu clneagu/.bashrc

forked from cjerdonek/.bashrc
Last active Jan 20, 2018
What would you like to do?
# Call virtualenvwrapper's "workon" if .venv exists. This is modified from--
# which is linked from--
check_virtualenv() {
if [ -e .venv ]; then
env=`cat .venv`
if [ "$env" != "${VIRTUAL_ENV##*/}" ]; then
echo "Found .venv in directory. Calling: workon ${env}"
workon $env
venv_cd () {
builtin cd "$@" && check_virtualenv
# Call check_virtualenv in case opening directly into a directory (e.g
# when opening a new tab in
# Add the following to ~/.bash_aliases:
# alias cd="venv_cd"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.