11# This file must be used with "source bin/activate" *from bash*
2- # You cannot run it directly
2+ # you cannot run it directly
33
44deactivate () {
55 # reset old environment variables
@@ -14,9 +14,12 @@ deactivate () {
1414 unset _OLD_VIRTUAL_PYTHONHOME
1515 fi
1616
17- # Call hash to forget past commands. Without forgetting
17+ # This should detect bash and zsh, which have a hash command that must
18+ # be called to get it to forget past commands. Without forgetting
1819 # past commands the $PATH changes we made may not be respected
19- hash -r 2> /dev/null
20+ if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
21+ hash -r 2> /dev/null
22+ fi
2023
2124 if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
2225 PS1="${_OLD_VIRTUAL_PS1:-}"
@@ -25,7 +28,6 @@ deactivate () {
2528 fi
2629
2730 unset VIRTUAL_ENV
28- unset VIRTUAL_ENV_PROMPT
2931 if [ ! "${1:-}" = "nondestructive" ] ; then
3032 # Self destruct!
3133 unset -f deactivate
@@ -35,18 +37,11 @@ deactivate () {
3537# unset irrelevant variables
3638deactivate nondestructive
3739
38- # on Windows, a path can contain colons and backslashes and has to be converted:
39- if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then
40- # transform D:\path\to\venv to /d/path/to/venv on MSYS
41- # and to /cygdrive/d/path/to/venv on Cygwin
42- export VIRTUAL_ENV=$(cygpath /home/tzemingho/GitHub/CYF/SDC/Module-Tools/implement-cowsay/.venv)
43- else
44- # use the path as-is
45- export VIRTUAL_ENV=/home/tzemingho/GitHub/CYF/SDC/Module-Tools/implement-cowsay/.venv
46- fi
40+ VIRTUAL_ENV="/Users/cyf/GitHub/SDC/Module-Tools/implement-cowsay/.venv"
41+ export VIRTUAL_ENV
4742
4843_OLD_VIRTUAL_PATH="$PATH"
49- PATH="$VIRTUAL_ENV/" bin" :$PATH"
44+ PATH="$VIRTUAL_ENV/bin:$PATH"
5045export PATH
5146
5247# unset PYTHONHOME if set
5954
6055if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
6156 _OLD_VIRTUAL_PS1="${PS1:-}"
62- PS1=' (.venv) '" ${PS1:-}"
57+ PS1=" (.venv) ${PS1:-}"
6358 export PS1
64- VIRTUAL_ENV_PROMPT='(.venv) '
65- export VIRTUAL_ENV_PROMPT
6659fi
6760
68- # Call hash to forget past commands. Without forgetting
61+ # This should detect bash and zsh, which have a hash command that must
62+ # be called to get it to forget past commands. Without forgetting
6963# past commands the $PATH changes we made may not be respected
70- hash -r 2> /dev/null
64+ if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
65+ hash -r 2> /dev/null
66+ fi
0 commit comments