This commit is contained in:
Chen Houwu 2014-01-04 18:38:27 +08:00
commit 6a58797dc6

View file

@ -22,10 +22,7 @@ if [[ ! $DISABLE_NODEENV_CD -eq 1 ]]; then
fi fi
source $NODEENV_NAME/bin/activate && export CD_NODEENV="$NODEENV_NAME" source $NODEENV_NAME/bin/activate && export CD_NODEENV="$NODEENV_NAME"
if [[ "$NODEENV_NAME" != "" ]]; then if [[ "$NODEENV_NAME" != "" ]]; then
# Activate the environment only if it is not already active source $NODEENV_NAME/bin/activate && export CD_NODEENV="$NODEENV_NAME"
if [[ "$NODE_VIRTUAL_ENV" != "$WORKON_HOME/$NODEENV_NAME" ]]; then
source $NODEENV_NAME/bin/activate && export CD_NODEENV="$NODEENV_NAME"
fi
elif [ $CD_NODEENV ]; then elif [ $CD_NODEENV ]; then
# We've just left the repo, deactivate the environment # We've just left the repo, deactivate the environment
# Note: this only happens if the virtualenv was activated automatically # Note: this only happens if the virtualenv was activated automatically