60
60
VIRTUALENVWRAPPER_ENV_BIN_DIR=" bin"
61
61
if [ " $OS " = " Windows_NT" ] && [ " $MSYSTEM " = " MINGW32" ]
62
62
then
63
- # Only assign this for msys, cygwin use standard Unix paths
64
- # and its own python installation
65
- VIRTUALENVWRAPPER_ENV_BIN_DIR=" Scripts"
63
+ # Only assign this for msys, cygwin use standard Unix paths
64
+ # and its own python installation
65
+ VIRTUALENVWRAPPER_ENV_BIN_DIR=" Scripts"
66
66
fi
67
67
68
68
# Let the user override the name of the file that holds the project
@@ -140,7 +140,7 @@ function virtualenvwrapper_tempfile {
140
140
# Note: the 'X's must come last
141
141
typeset suffix=${1:- hook}
142
142
typeset file
143
-
143
+
144
144
file=" ` \m ktemp -t virtualenvwrapper-$suffix -XXXXXXXXXX` "
145
145
if [ $? -ne 0 ] || [ -z " $file " ] || [ ! -f " $file " ]
146
146
then
@@ -155,13 +155,13 @@ function virtualenvwrapper_tempfile {
155
155
function virtualenvwrapper_run_hook {
156
156
typeset hook_script
157
157
typeset result
158
-
158
+
159
159
hook_script=" $( virtualenvwrapper_tempfile ${1} -hook) " || return 1
160
160
161
161
if [ -z " $VIRTUALENVWRAPPER_LOG_DIR " ]
162
162
then
163
163
echo " ERROR: VIRTUALENVWRAPPER_LOG_DIR is not set." 1>&2
164
- \r m -f " $hook_script "
164
+ \r m -f " $hook_script "
165
165
return 1
166
166
fi
167
167
" $VIRTUALENVWRAPPER_PYTHON " -c ' from virtualenvwrapper.hook_loader import main; main()' $HOOK_VERBOSE_OPTION --script " $hook_script " " $@ "
@@ -172,7 +172,7 @@ function virtualenvwrapper_run_hook {
172
172
if [ ! -f " $hook_script " ]
173
173
then
174
174
echo " ERROR: virtualenvwrapper_run_hook could not find temporary file $hook_script " 1>&2
175
- \r m -f " $hook_script "
175
+ \r m -f " $hook_script "
176
176
return 2
177
177
fi
178
178
# cat "$hook_script"
@@ -386,8 +386,8 @@ function mkvirtualenv {
386
386
# we should switch to the environment and run the hook.
387
387
[ ! -d " $WORKON_HOME /$envname " ] && return 0
388
388
389
- # If they gave us a project directory, set it up now
390
- # so the activate hooks can find it.
389
+ # If they gave us a project directory, set it up now
390
+ # so the activate hooks can find it.
391
391
if [ ! -z " $project " ]
392
392
then
393
393
setvirtualenvproject " $WORKON_HOME /$envname " " $project "
@@ -474,38 +474,38 @@ function lsvirtualenv {
474
474
typeset long_mode=true
475
475
if command -v " getopts" & > /dev/null
476
476
then
477
- # Use getopts when possible
478
- OPTIND=1
479
- while getopts " :blh" opt " $@ "
480
- do
481
- case " $opt " in
482
- l) long_mode=true;;
483
- b) long_mode=false;;
484
- h) _lsvirtualenv_usage;
485
- return 1;;
486
- ? ) echo " Invalid option: -$OPTARG " >&2 ;
487
- _lsvirtualenv_usage;
488
- return 1;;
489
- esac
490
- done
477
+ # Use getopts when possible
478
+ OPTIND=1
479
+ while getopts " :blh" opt " $@ "
480
+ do
481
+ case " $opt " in
482
+ l) long_mode=true;;
483
+ b) long_mode=false;;
484
+ h) _lsvirtualenv_usage;
485
+ return 1;;
486
+ ? ) echo " Invalid option: -$OPTARG " >&2 ;
487
+ _lsvirtualenv_usage;
488
+ return 1;;
489
+ esac
490
+ done
491
491
else
492
- # fallback on getopt for other shell
493
- typeset -a args
494
- args=($( getopt blh " $@ " ) )
495
- if [ $? != 0 ]
496
- then
497
- _lsvirtualenv_usage
498
- return 1
499
- fi
500
- for opt in $args
501
- do
502
- case " $opt " in
503
- -l) long_mode=true;;
504
- -b) long_mode=false;;
505
- -h) _lsvirtualenv_usage;
506
- return 1;;
507
- esac
508
- done
492
+ # fallback on getopt for other shell
493
+ typeset -a args
494
+ args=($( getopt blh " $@ " ) )
495
+ if [ $? != 0 ]
496
+ then
497
+ _lsvirtualenv_usage
498
+ return 1
499
+ fi
500
+ for opt in $args
501
+ do
502
+ case " $opt " in
503
+ -l) long_mode=true;;
504
+ -b) long_mode=false;;
505
+ -h) _lsvirtualenv_usage;
506
+ return 1;;
507
+ esac
508
+ done
509
509
fi
510
510
511
511
if $long_mode
@@ -544,8 +544,8 @@ function showvirtualenv {
544
544
# Usage: workon [environment_name]
545
545
#
546
546
function workon {
547
- typeset env_name=" $1 "
548
- if [ " $env_name " = " " ]
547
+ typeset env_name=" $1 "
548
+ if [ " $env_name " = " " ]
549
549
then
550
550
lsvirtualenv -b
551
551
return 1
@@ -606,7 +606,7 @@ function workon {
606
606
607
607
virtualenvwrapper_run_hook " post_activate"
608
608
609
- return 0
609
+ return 0
610
610
}
611
611
612
612
0 commit comments