From 403859ae80eb343f7d940d98e373263e4cf631fe Mon Sep 17 00:00:00 2001 From: mail6543210 Date: Tue, 16 Jun 2015 22:34:20 +0800 Subject: [PATCH] Use `cd -P` instead of `realpath` (fixes #4030) --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 9fd0d3d8f..9c11c7bbb 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -36,10 +36,10 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then function workon_cwd { if [ ! $WORKON_CWD ]; then WORKON_CWD=1 - # Check if this is a Git repo + # Look for a proper PROJECT_ROOT path PROJECT_ROOT=`pwd` while [[ "$PROJECT_ROOT" != "/" && ! -e "$PROJECT_ROOT/.venv" ]]; do - PROJECT_ROOT=`realpath $PROJECT_ROOT/..` + PROJECT_ROOT=$(cd -P "$PROJECT_ROOT/.."; pwd) done if [[ "$PROJECT_ROOT" == "/" ]]; then PROJECT_ROOT="."