Use path comparison not string comparison for paths
This will solve part of issue #4255 where WORKON_HOME is defined with a trailing slash or not normalised in some way, as well as instances where symlinks are used, and any other instances where constructed paths don't exactly match even though they go to the same file.
This commit is contained in:
parent
cc9695b081
commit
31afbc760e
@ -55,7 +55,7 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
if [[ "$ENV_NAME" != "" ]]; then
|
if [[ "$ENV_NAME" != "" ]]; then
|
||||||
# Activate the environment only if it is not already active
|
# Activate the environment only if it is not already active
|
||||||
if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then
|
if [[ ! "$VIRTUAL_ENV" -ef "$WORKON_HOME/$ENV_NAME" ]]; then
|
||||||
if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then
|
if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then
|
||||||
workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME"
|
workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME"
|
||||||
elif [[ -e "$ENV_NAME/bin/activate" ]]; then
|
elif [[ -e "$ENV_NAME/bin/activate" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user