5757fi
5858
5959# Define script folder depending on the platorm (Win32/Unix)
60- script_folder =" bin"
60+ VIRTUALENVWRAPPER_ENV_BIN_DIR =" bin"
6161if [ " $OS " = " Windows_NT" ] && [ " $MSYSTEM " = " MINGW32" ]
6262then
6363 # Only assign this for msys, cygwin use standard Unix paths
6464 # and its own python installation
65- script_folder =" Scripts"
65+ VIRTUALENVWRAPPER_ENV_BIN_DIR =" Scripts"
6666fi
6767
6868virtualenvwrapper_derive_workon_home () {
@@ -286,7 +286,7 @@ virtualenvwrapper_show_workon_options () {
286286 # NOTE: DO NOT use ls here because colorized versions spew control characters
287287 # into the output list.
288288 # 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 ' ^\*$' )
290290
291291# (cd "$WORKON_HOME"; find -L . -depth 3 -path '*/bin/activate') | sed 's|^\./||' | sed 's|/bin/activate||' | sort
292292}
@@ -366,7 +366,7 @@ workon () {
366366 virtualenvwrapper_verify_workon_home || return 1
367367 virtualenvwrapper_verify_workon_environment $env_name || return 1
368368
369- activate=" $WORKON_HOME /$env_name /$script_folder /activate"
369+ activate=" $WORKON_HOME /$env_name /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate"
370370 if [ ! -f " $activate " ]
371371 then
372372 echo " ERROR: Environment '$WORKON_HOME /$env_name ' does not contain an activate script." >&2
@@ -399,7 +399,7 @@ workon () {
399399 # any settings made by the local postactivate first.
400400 virtualenvwrapper_run_hook "pre_deactivate"
401401
402- env_postdeactivate_hook="$VIRTUAL_ENV/$script_folder /postdeactivate"
402+ env_postdeactivate_hook="$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR /postdeactivate"
403403 old_env=$(basename "$VIRTUAL_ENV")
404404
405405 # Call the original function.
@@ -598,7 +598,7 @@ cpvirtualenv() {
598598 fi
599599
600600 \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 /* )
602602 do
603603 newscript=" $script -new"
604604 \s ed " s|$source_env |$target_env |g" < " $script " > " $newscript "
@@ -607,7 +607,7 @@ cpvirtualenv() {
607607 done
608608
609609 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"
611611
612612 (cd " $WORKON_HOME " && (
613613 virtualenvwrapper_run_hook " pre_cpvirtualenv" " $env_name " " $new_env " ;
0 commit comments