#!bash
#
# virtualenvwrapper initialization.

export VIRTUALENV_DISTRIBUTE=1
export VIRTUAL_ENV_DISABLE_PROMPT=1
# MRB Custom: Uncomment this to create project directories if mkvirtualenv is
# executed under the Projects directory, and to setup postactivate to change
# into the project directory.
#export VIRTUALENV_CREATE_PROJECT_DIR=1

__garbage VENVWRAPPERSH
VENVWRAPPERSH=$(type -P virtualenvwrapper.sh /usr/local/bin/virtualenvwrapper.sh | head -1)

if [[ -n "$VENVWRAPPERSH" ]]; then
  export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'

  if [[ -z "$WORKON_HOME" ]]; then
    export WORKON_HOME="$HOME/.virtualenvs"
  else
    # Make sure the directory is in a format compatible with the shell.
    export WORKON_HOME="$(cd "$WORKON_HOME" && pwd)"
  fi
  source "$VENVWRAPPERSH"

  # Preserve the directory we were in before mkvirtualenv is called. Use this
  # to determine whether or not we were in a directory named "Projects". If we
  # are, supply this directory to mkvirtualenv.
  # "Copy function" trick taken from http://stackoverflow.com/a/1369211.
  eval "$(echo "orig_mkvirtualenv()"; declare -f mkvirtualenv | tail -n +2)"
  function mkvirtualenv {
    MKVIRTUALENV_PWD="$(pwd)" orig_mkvirtualenv "$@"
  }

  export PIP_VIRTUALENV_BASE=$WORKON_HOME
  export PIP_RESPECT_VIRTUALENV=true
fi

#!bash
#
# virtualenvwrapper initialization.

export VIRTUAL_ENV_DISABLE_PROMPT=1
# MRB Custom: Uncomment this to create project directories if mkvirtualenv is
# executed under the Projects directory, and to setup postactivate to change
# into the project directory.
#export VIRTUALENV_CREATE_PROJECT_DIR=1

__garbage VENVWRAPPERSH
VENVWRAPPERSH=$(type -P virtualenvwrapper.sh /usr/local/bin/virtualenvwrapper.sh | head -1)

if [[ -n "$VENVWRAPPERSH" ]]; then
  export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'

  if [[ -z "$WORKON_HOME" ]]; then
    export WORKON_HOME="$HOME/.virtualenvs"
  else
    # Make sure the directory is in a format compatible with the shell.
    export WORKON_HOME="$(cd "$WORKON_HOME" && pwd)"
  fi
  source "$VENVWRAPPERSH"

  # Preserve the directory we were in before mkvirtualenv is called. Use this
  # to determine whether or not we were in a directory named "Projects". If we
  # are, supply this directory to mkvirtualenv.
  # "Copy function" trick taken from http://stackoverflow.com/a/1369211.
  eval "$(echo "orig_mkvirtualenv()"; declare -f mkvirtualenv | tail -n +2)"
  function mkvirtualenv {
    MKVIRTUALENV_PWD="$(pwd)" orig_mkvirtualenv "$@"
  }

  export PIP_VIRTUALENV_BASE=$WORKON_HOME
  export PIP_RESPECT_VIRTUALENV=true
fi

Remove the VIRTUALENV_DISTRIBUTE environment variable.
Remove the VIRTUALENV_DISTRIBUTE environment variable.
