| 
45 | 45 | #  | 
46 | 46 | 
 
  | 
47 | 47 | # Locate the global Python where virtualenvwrapper is installed.  | 
48 |  | -if [ "$VIRTUALENVWRAPPER_PYTHON" = "" ]  | 
 | 48 | +if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ]  | 
49 | 49 | then  | 
50 | 50 |     VIRTUALENVWRAPPER_PYTHON="$(command \which python)"  | 
51 | 51 | fi  | 
52 | 52 | 
 
  | 
53 | 53 | # Set the name of the virtualenv app to use.  | 
54 |  | -if [ "$VIRTUALENVWRAPPER_VIRTUALENV" = "" ]  | 
 | 54 | +if [ "${VIRTUALENVWRAPPER_VIRTUALENV:-}" = "" ]  | 
55 | 55 | then  | 
56 | 56 |     VIRTUALENVWRAPPER_VIRTUALENV="virtualenv"  | 
57 | 57 | fi  | 
58 | 58 | 
 
  | 
59 | 59 | # Set the name of the virtualenv-clone app to use.  | 
60 |  | -if [ "$VIRTUALENVWRAPPER_VIRTUALENV_CLONE" = "" ]  | 
 | 60 | +if [ "${VIRTUALENVWRAPPER_VIRTUALENV_CLONE:-}" = "" ]  | 
61 | 61 | then  | 
62 | 62 |     VIRTUALENVWRAPPER_VIRTUALENV_CLONE="virtualenv-clone"  | 
63 | 63 | fi  | 
64 | 64 | 
 
  | 
65 | 65 | # Define script folder depending on the platorm (Win32/Unix)  | 
66 | 66 | VIRTUALENVWRAPPER_ENV_BIN_DIR="bin"  | 
67 |  | -if [ "$OS" = "Windows_NT" ] && ([ "$MSYSTEM" = "MINGW32" ] || [ "$MSYSTEM" = "MINGW64" ])  | 
 | 67 | +if [ "${OS:-}" = "Windows_NT" ] && ([ "${MSYSTEM:-}" = "MINGW32" ] || [ "${MSYSTEM:-}" = "MINGW64" ])  | 
68 | 68 | then  | 
69 | 69 |     # Only assign this for msys, cygwin use standard Unix paths  | 
70 | 70 |     # and its own python installation  | 
 | 
73 | 73 | 
 
  | 
74 | 74 | # Let the user override the name of the file that holds the project  | 
75 | 75 | # directory name.  | 
76 |  | -if [ "$VIRTUALENVWRAPPER_PROJECT_FILENAME" = "" ]  | 
 | 76 | +if [ "${VIRTUALENVWRAPPER_PROJECT_FILENAME:-}" = "" ]  | 
77 | 77 | then  | 
78 | 78 |     export VIRTUALENVWRAPPER_PROJECT_FILENAME=".project"  | 
79 | 79 | fi  | 
 | 
83 | 83 | export VIRTUALENVWRAPPER_WORKON_CD=${VIRTUALENVWRAPPER_WORKON_CD:-1}  | 
84 | 84 | 
 
  | 
85 | 85 | # Remember where we are running from.  | 
86 |  | -if [ -z "$VIRTUALENVWRAPPER_SCRIPT" ]  | 
 | 86 | +if [ -z "${VIRTUALENVWRAPPER_SCRIPT:-}" ]  | 
87 | 87 | then  | 
88 | 88 |     if [ -n "$BASH" ]  | 
89 | 89 |     then  | 
 | 
108 | 108 | # we are trying to change the state of the current shell, so we use  | 
109 | 109 | # "builtin" for bash and zsh but "command" under ksh.  | 
110 | 110 | function virtualenvwrapper_cd {  | 
111 |  | -    if [ -n "$BASH" ]  | 
 | 111 | +    if [ -n "${BASH:-}" ]  | 
112 | 112 |     then  | 
113 | 113 |         builtin \cd "$@"  | 
114 |  | -    elif [ -n "$ZSH_VERSION" ]  | 
 | 114 | +    elif [ -n "${ZSH_VERSION:-}" ]  | 
115 | 115 |     then  | 
116 | 116 |         builtin \cd -q "$@"  | 
117 | 117 |     else  | 
@@ -228,7 +228,7 @@ function virtualenvwrapper_run_hook {  | 
228 | 228 |     ( \  | 
229 | 229 |         virtualenvwrapper_cd "$WORKON_HOME" &&  | 
230 | 230 |         "$VIRTUALENVWRAPPER_PYTHON" -m 'virtualenvwrapper.hook_loader' \  | 
231 |  | -            $HOOK_VERBOSE_OPTION --script "$hook_script" "$@" \  | 
 | 231 | +            ${HOOK_VERBOSE_OPTION:-} --script "$hook_script" "$@" \  | 
232 | 232 |     )  | 
233 | 233 |     result=$?  | 
234 | 234 | 
 
  | 
 | 
260 | 260 | # Set up tab completion.  (Adapted from Arthur Koziel's version at  | 
261 | 261 | # http://arthurkoziel.com/2008/10/11/virtualenvwrapper-bash-completion/)  | 
262 | 262 | function virtualenvwrapper_setup_tab_completion {  | 
263 |  | -    if [ -n "$BASH" ] ; then  | 
 | 263 | +    if [ -n "${BASH:-}" ] ; then  | 
264 | 264 |         _virtualenvs () {  | 
265 | 265 |             local cur="${COMP_WORDS[COMP_CWORD]}"  | 
266 | 266 |             COMPREPLY=( $(compgen -W "`virtualenvwrapper_show_workon_options`" -- ${cur}) )  | 
 | 
0 commit comments