Skip to content

Commit 896cfeb

Browse files
committed
Use spaces for indentation consistently instead of mixed spaces/tabs. No functional changes.
1 parent 515d9eb commit 896cfeb

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

virtualenvwrapper.sh

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ fi
6060
VIRTUALENVWRAPPER_ENV_BIN_DIR="bin"
6161
if [ "$OS" = "Windows_NT" ] && [ "$MSYSTEM" = "MINGW32" ]
6262
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"
6666
fi
6767

6868
# Let the user override the name of the file that holds the project
@@ -131,7 +131,7 @@ function virtualenvwrapper_tempfile {
131131
# Note: the 'X's must come last
132132
typeset suffix=${1:-hook}
133133
typeset file
134-
134+
135135
file="`\mktemp -t virtualenvwrapper-$suffix-XXXXXXXXXX`"
136136
if [ $? -ne 0 ] || [ -z "$file" ] || [ ! -f "$file" ]
137137
then
@@ -146,13 +146,13 @@ function virtualenvwrapper_tempfile {
146146
function virtualenvwrapper_run_hook {
147147
typeset hook_script
148148
typeset result
149-
149+
150150
hook_script="$(virtualenvwrapper_tempfile ${1}-hook)" || return 1
151151

152152
if [ -z "$VIRTUALENVWRAPPER_LOG_DIR" ]
153153
then
154154
echo "ERROR: VIRTUALENVWRAPPER_LOG_DIR is not set." 1>&2
155-
\rm -f "$hook_script"
155+
\rm -f "$hook_script"
156156
return 1
157157
fi
158158
"$VIRTUALENVWRAPPER_PYTHON" -c 'from virtualenvwrapper.hook_loader import main; main()' $HOOK_VERBOSE_OPTION --script "$hook_script" "$@"
@@ -163,7 +163,7 @@ function virtualenvwrapper_run_hook {
163163
if [ ! -f "$hook_script" ]
164164
then
165165
echo "ERROR: virtualenvwrapper_run_hook could not find temporary file $hook_script" 1>&2
166-
\rm -f "$hook_script"
166+
\rm -f "$hook_script"
167167
return 2
168168
fi
169169
# cat "$hook_script"
@@ -376,8 +376,8 @@ function mkvirtualenv {
376376
# we should switch to the environment and run the hook.
377377
[ ! -d "$WORKON_HOME/$envname" ] && return 0
378378

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.
381381
if [ ! -z "$project" ]
382382
then
383383
setvirtualenvproject "$WORKON_HOME/$envname" "$project"
@@ -464,38 +464,38 @@ function lsvirtualenv {
464464
typeset long_mode=true
465465
if command -v "getopts" &> /dev/null
466466
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
481481
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
499499
fi
500500

501501
if $long_mode
@@ -534,8 +534,8 @@ function showvirtualenv {
534534
# Usage: workon [environment_name]
535535
#
536536
function workon {
537-
typeset env_name="$1"
538-
if [ "$env_name" = "" ]
537+
typeset env_name="$1"
538+
if [ "$env_name" = "" ]
539539
then
540540
lsvirtualenv -b
541541
return 1
@@ -596,7 +596,7 @@ function workon {
596596

597597
virtualenvwrapper_run_hook "post_activate"
598598

599-
return 0
599+
return 0
600600
}
601601

602602

0 commit comments

Comments
 (0)