Skip to content

Commit c930052

Browse files
committed
Merged in fix/263 (pull request #60)
Fix Bash Strict mode
2 parents c51e431 + f7c3ead commit c930052

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

docs/source/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ can download virtualenvwrapper-powershell_ from PyPI.
7676
Python Versions
7777
===============
7878

79-
virtualenvwrapper is tested under Python 2.6-3.4.
79+
virtualenvwrapper is tested under Python 2.7-3.6.
8080

8181
.. _install-basic:
8282

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27,py26,py33,py34,py35,zsh,ksh,style
2+
envlist = py27,py26,py33,py34,py35,py36,zsh,ksh,style
33

44
[testenv]
55
install_command = pip install -U {opts} {packages}
@@ -49,4 +49,4 @@ basepython=python2.7
4949
deps =
5050
-r{toxinidir}/requirements.txt
5151
-r{toxinidir}/docs/requirements.txt
52-
commands = python setup.py build_sphinx
52+
commands = python setup.py build_sphinx

virtualenvwrapper.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,26 @@
4545
#
4646

4747
# Locate the global Python where virtualenvwrapper is installed.
48-
if [ "$VIRTUALENVWRAPPER_PYTHON" = "" ]
48+
if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ]
4949
then
5050
VIRTUALENVWRAPPER_PYTHON="$(command \which python)"
5151
fi
5252

5353
# Set the name of the virtualenv app to use.
54-
if [ "$VIRTUALENVWRAPPER_VIRTUALENV" = "" ]
54+
if [ "${VIRTUALENVWRAPPER_VIRTUALENV:-}" = "" ]
5555
then
5656
VIRTUALENVWRAPPER_VIRTUALENV="virtualenv"
5757
fi
5858

5959
# Set the name of the virtualenv-clone app to use.
60-
if [ "$VIRTUALENVWRAPPER_VIRTUALENV_CLONE" = "" ]
60+
if [ "${VIRTUALENVWRAPPER_VIRTUALENV_CLONE:-}" = "" ]
6161
then
6262
VIRTUALENVWRAPPER_VIRTUALENV_CLONE="virtualenv-clone"
6363
fi
6464

6565
# Define script folder depending on the platorm (Win32/Unix)
6666
VIRTUALENVWRAPPER_ENV_BIN_DIR="bin"
67-
if [ "$OS" = "Windows_NT" ] && ([ "$MSYSTEM" = "MINGW32" ] || [ "$MSYSTEM" = "MINGW64" ])
67+
if [ "${OS:-}" = "Windows_NT" ] && ([ "${MSYSTEM:-}" = "MINGW32" ] || [ "${MSYSTEM:-}" = "MINGW64" ])
6868
then
6969
# Only assign this for msys, cygwin use standard Unix paths
7070
# and its own python installation
@@ -73,7 +73,7 @@ fi
7373

7474
# Let the user override the name of the file that holds the project
7575
# directory name.
76-
if [ "$VIRTUALENVWRAPPER_PROJECT_FILENAME" = "" ]
76+
if [ "${VIRTUALENVWRAPPER_PROJECT_FILENAME:-}" = "" ]
7777
then
7878
export VIRTUALENVWRAPPER_PROJECT_FILENAME=".project"
7979
fi
@@ -83,7 +83,7 @@ fi
8383
export VIRTUALENVWRAPPER_WORKON_CD=${VIRTUALENVWRAPPER_WORKON_CD:-1}
8484

8585
# Remember where we are running from.
86-
if [ -z "$VIRTUALENVWRAPPER_SCRIPT" ]
86+
if [ -z "${VIRTUALENVWRAPPER_SCRIPT:-}" ]
8787
then
8888
if [ -n "$BASH" ]
8989
then
@@ -108,10 +108,10 @@ fi
108108
# we are trying to change the state of the current shell, so we use
109109
# "builtin" for bash and zsh but "command" under ksh.
110110
function virtualenvwrapper_cd {
111-
if [ -n "$BASH" ]
111+
if [ -n "${BASH:-}" ]
112112
then
113113
builtin \cd "$@"
114-
elif [ -n "$ZSH_VERSION" ]
114+
elif [ -n "${ZSH_VERSION:-}" ]
115115
then
116116
builtin \cd -q "$@"
117117
else
@@ -228,7 +228,7 @@ function virtualenvwrapper_run_hook {
228228
( \
229229
virtualenvwrapper_cd "$WORKON_HOME" &&
230230
"$VIRTUALENVWRAPPER_PYTHON" -m 'virtualenvwrapper.hook_loader' \
231-
$HOOK_VERBOSE_OPTION --script "$hook_script" "$@" \
231+
${HOOK_VERBOSE_OPTION:-} --script "$hook_script" "$@" \
232232
)
233233
result=$?
234234

@@ -260,7 +260,7 @@ EOF
260260
# Set up tab completion. (Adapted from Arthur Koziel's version at
261261
# http://arthurkoziel.com/2008/10/11/virtualenvwrapper-bash-completion/)
262262
function virtualenvwrapper_setup_tab_completion {
263-
if [ -n "$BASH" ] ; then
263+
if [ -n "${BASH:-}" ] ; then
264264
_virtualenvs () {
265265
local cur="${COMP_WORDS[COMP_CWORD]}"
266266
COMPREPLY=( $(compgen -W "`virtualenvwrapper_show_workon_options`" -- ${cur}) )

0 commit comments

Comments
 (0)