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
@@ -131,7 +131,7 @@ function virtualenvwrapper_tempfile {
131
131
# Note: the 'X's must come last
132
132
typeset suffix=${1:- hook}
133
133
typeset file
134
-
134
+
135
135
file=" ` \m ktemp -t virtualenvwrapper-$suffix -XXXXXXXXXX` "
136
136
if [ $? -ne 0 ] || [ -z " $file " ] || [ ! -f " $file " ]
137
137
then
@@ -146,13 +146,13 @@ function virtualenvwrapper_tempfile {
146
146
function virtualenvwrapper_run_hook {
147
147
typeset hook_script
148
148
typeset result
149
-
149
+
150
150
hook_script=" $( virtualenvwrapper_tempfile ${1} -hook) " || return 1
151
151
152
152
if [ -z " $VIRTUALENVWRAPPER_LOG_DIR " ]
153
153
then
154
154
echo " ERROR: VIRTUALENVWRAPPER_LOG_DIR is not set." 1>&2
155
- \r m -f " $hook_script "
155
+ \r m -f " $hook_script "
156
156
return 1
157
157
fi
158
158
" $VIRTUALENVWRAPPER_PYTHON " -c ' from virtualenvwrapper.hook_loader import main; main()' $HOOK_VERBOSE_OPTION --script " $hook_script " " $@ "
@@ -163,7 +163,7 @@ function virtualenvwrapper_run_hook {
163
163
if [ ! -f " $hook_script " ]
164
164
then
165
165
echo " ERROR: virtualenvwrapper_run_hook could not find temporary file $hook_script " 1>&2
166
- \r m -f " $hook_script "
166
+ \r m -f " $hook_script "
167
167
return 2
168
168
fi
169
169
# cat "$hook_script"
@@ -376,8 +376,8 @@ function mkvirtualenv {
376
376
# we should switch to the environment and run the hook.
377
377
[ ! -d " $WORKON_HOME /$envname " ] && return 0
378
378
379
- # If they gave us a project directory, set it up now
380
- # so the activate hooks can find it.
379
+ # If they gave us a project directory, set it up now
380
+ # so the activate hooks can find it.
381
381
if [ ! -z " $project " ]
382
382
then
383
383
setvirtualenvproject " $WORKON_HOME /$envname " " $project "
@@ -464,38 +464,38 @@ function lsvirtualenv {
464
464
typeset long_mode=true
465
465
if command -v " getopts" & > /dev/null
466
466
then
467
- # Use getopts when possible
468
- OPTIND=1
469
- while getopts " :blh" opt " $@ "
470
- do
471
- case " $opt " in
472
- l) long_mode=true;;
473
- b) long_mode=false;;
474
- h) _lsvirtualenv_usage;
475
- return 1;;
476
- ? ) echo " Invalid option: -$OPTARG " >&2 ;
477
- _lsvirtualenv_usage;
478
- return 1;;
479
- esac
480
- done
467
+ # Use getopts when possible
468
+ OPTIND=1
469
+ while getopts " :blh" opt " $@ "
470
+ do
471
+ case " $opt " in
472
+ l) long_mode=true;;
473
+ b) long_mode=false;;
474
+ h) _lsvirtualenv_usage;
475
+ return 1;;
476
+ ? ) echo " Invalid option: -$OPTARG " >&2 ;
477
+ _lsvirtualenv_usage;
478
+ return 1;;
479
+ esac
480
+ done
481
481
else
482
- # fallback on getopt for other shell
483
- typeset -a args
484
- args=($( getopt blh " $@ " ) )
485
- if [ $? != 0 ]
486
- then
487
- _lsvirtualenv_usage
488
- return 1
489
- fi
490
- for opt in $args
491
- do
492
- case " $opt " in
493
- -l) long_mode=true;;
494
- -b) long_mode=false;;
495
- -h) _lsvirtualenv_usage;
496
- return 1;;
497
- esac
498
- done
482
+ # fallback on getopt for other shell
483
+ typeset -a args
484
+ args=($( getopt blh " $@ " ) )
485
+ if [ $? != 0 ]
486
+ then
487
+ _lsvirtualenv_usage
488
+ return 1
489
+ fi
490
+ for opt in $args
491
+ do
492
+ case " $opt " in
493
+ -l) long_mode=true;;
494
+ -b) long_mode=false;;
495
+ -h) _lsvirtualenv_usage;
496
+ return 1;;
497
+ esac
498
+ done
499
499
fi
500
500
501
501
if $long_mode
@@ -534,8 +534,8 @@ function showvirtualenv {
534
534
# Usage: workon [environment_name]
535
535
#
536
536
function workon {
537
- typeset env_name=" $1 "
538
- if [ " $env_name " = " " ]
537
+ typeset env_name=" $1 "
538
+ if [ " $env_name " = " " ]
539
539
then
540
540
lsvirtualenv -b
541
541
return 1
@@ -596,7 +596,7 @@ function workon {
596
596
597
597
virtualenvwrapper_run_hook " post_activate"
598
598
599
- return 0
599
+ return 0
600
600
}
601
601
602
602
0 commit comments