Skip to content

Commit 868a4ee

Browse files
committed
Always use virtualenvwrapper_cd instead of cd.
1 parent a6f615e commit 868a4ee

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

virtualenvwrapper.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ function virtualenvwrapper_run_hook {
207207
# Python 3 interpreter decide that its "prefix" is the virtualenv
208208
# if we happen to be inside the virtualenv when we start.
209209
( \
210-
cd "$WORKON_HOME" &&
210+
virtualenvwrapper_cd "$WORKON_HOME" &&
211211
"$VIRTUALENVWRAPPER_PYTHON" -m 'virtualenvwrapper.hook_loader' \
212212
$HOOK_VERBOSE_OPTION --script "$hook_script" "$@" \
213213
)
@@ -534,7 +534,7 @@ function virtualenvwrapper_show_workon_options {
534534
# 4. Format the output to show one name on a line.
535535
# 5. Eliminate any lines with * on them because that means there
536536
# were no envs.
537-
(cd "$WORKON_HOME" && echo */$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate) 2>/dev/null \
537+
(virtualenvwrapper_cd "$WORKON_HOME" && echo */$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate) 2>/dev/null \
538538
| command \sed "s|/$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate||g" \
539539
| command \fmt -w 1 \
540540
| (unset GREP_OPTIONS; command \egrep -v '^\*$') 2>/dev/null
@@ -1046,15 +1046,15 @@ function mkproject {
10461046

10471047
mkvirtualenv "$@" || return 1
10481048

1049-
cd "$PROJECT_HOME"
1049+
virtualenvwrapper_cd "$PROJECT_HOME"
10501050

10511051
virtualenvwrapper_run_hook "project.pre_mkproject" $envname
10521052

10531053
echo "Creating $PROJECT_HOME/$envname"
10541054
mkdir -p "$PROJECT_HOME/$envname"
10551055
setvirtualenvproject "$VIRTUAL_ENV" "$PROJECT_HOME/$envname"
10561056

1057-
cd "$PROJECT_HOME/$envname"
1057+
virtualenvwrapper_cd "$PROJECT_HOME/$envname"
10581058

10591059
for t in $templates
10601060
do
@@ -1078,7 +1078,7 @@ function cdproject {
10781078
typeset project_dir="$(cat "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME")"
10791079
if [ ! -z "$project_dir" ]
10801080
then
1081-
cd "$project_dir"
1081+
virtualenvwrapper_cd "$project_dir"
10821082
else
10831083
echo "Project directory $project_dir does not exist" 1>&2
10841084
return 1
@@ -1168,7 +1168,7 @@ function allvirtualenv {
11681168
# Activate the environment, but not with workon
11691169
# because we don't want to trigger any hooks.
11701170
(source "$WORKON_HOME/$d/bin/activate";
1171-
cd "$VIRTUAL_ENV";
1171+
virtualenvwrapper_cd "$VIRTUAL_ENV";
11721172
"$@")
11731173
echo
11741174
done

0 commit comments

Comments
 (0)