57
57
fi
58
58
59
59
# Define script folder depending on the platorm (Win32/Unix)
60
- script_folder =" bin"
60
+ VIRTUALENVWRAPPER_ENV_BIN_DIR =" bin"
61
61
if [ " $OS " = " Windows_NT" ] && [ " $MSYSTEM " = " MINGW32" ]
62
62
then
63
63
# Only assign this for msys, cygwin use standard Unix paths
64
64
# and its own python installation
65
- script_folder =" Scripts"
65
+ VIRTUALENVWRAPPER_ENV_BIN_DIR =" Scripts"
66
66
fi
67
67
68
68
virtualenvwrapper_derive_workon_home () {
@@ -286,7 +286,7 @@ virtualenvwrapper_show_workon_options () {
286
286
# NOTE: DO NOT use ls here because colorized versions spew control characters
287
287
# into the output list.
288
288
# echo seems a little faster than find, even with -depth 3.
289
- (cd " $WORKON_HOME " ; for f in * /$script_folder /activate; do echo $f ; done) 2> /dev/null | \s ed ' s|^\./||' | \s ed ' s|/bin/activate||' | \s ort | (unset GREP_OPTIONS; \e grep -v ' ^\*$' )
289
+ (cd " $WORKON_HOME " ; for f in * /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate; do echo $f ; done) 2> /dev/null | \s ed ' s|^\./||' | \s ed ' s|/bin/activate||' | \s ort | (unset GREP_OPTIONS; \e grep -v ' ^\*$' )
290
290
291
291
# (cd "$WORKON_HOME"; find -L . -depth 3 -path '*/bin/activate') | sed 's|^\./||' | sed 's|/bin/activate||' | sort
292
292
}
@@ -366,7 +366,7 @@ workon () {
366
366
virtualenvwrapper_verify_workon_home || return 1
367
367
virtualenvwrapper_verify_workon_environment $env_name || return 1
368
368
369
- activate=" $WORKON_HOME /$env_name /$script_folder /activate"
369
+ activate=" $WORKON_HOME /$env_name /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate"
370
370
if [ ! -f " $activate " ]
371
371
then
372
372
echo " ERROR: Environment '$WORKON_HOME /$env_name ' does not contain an activate script." >&2
@@ -399,7 +399,7 @@ workon () {
399
399
# any settings made by the local postactivate first.
400
400
virtualenvwrapper_run_hook "pre_deactivate"
401
401
402
- env_postdeactivate_hook="$VIRTUAL_ENV/$script_folder /postdeactivate"
402
+ env_postdeactivate_hook="$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR /postdeactivate"
403
403
old_env=$(basename "$VIRTUAL_ENV")
404
404
405
405
# Call the original function.
@@ -598,7 +598,7 @@ cpvirtualenv() {
598
598
fi
599
599
600
600
\c p -r " $source_env " " $target_env "
601
- for script in $( \l s $target_env /$script_folder /* )
601
+ for script in $( \l s $target_env /$VIRTUALENVWRAPPER_ENV_BIN_DIR /* )
602
602
do
603
603
newscript=" $script -new"
604
604
\s ed " s|$source_env |$target_env |g" < " $script " > " $newscript "
@@ -607,7 +607,7 @@ cpvirtualenv() {
607
607
done
608
608
609
609
virtualenv " $target_env " --relocatable
610
- \s ed " s/VIRTUAL_ENV\(.*\)$env_name /VIRTUAL_ENV\1$new_env /g" < " $source_env /bin/activate" > " $target_env /$script_folder /activate"
610
+ \s ed " s/VIRTUAL_ENV\(.*\)$env_name /VIRTUAL_ENV\1$new_env /g" < " $source_env /bin/activate" > " $target_env /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate"
611
611
612
612
(cd " $WORKON_HOME " && (
613
613
virtualenvwrapper_run_hook " pre_cpvirtualenv" " $env_name " " $new_env " ;
0 commit comments