Use cd -P instead of realpath (fixes #4030)

This commit is contained in:
mail6543210 2015-06-16 22:34:20 +08:00
commit 403859ae80

View file

@ -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="."