File tree Expand file tree Collapse file tree 2 files changed +35
-3
lines changed
Expand file tree Collapse file tree 2 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,39 @@ if [ -d "$PROJECT_FOLDER/venv" ]; then
148148 if [ -n " ${VIRTUAL_ENV} " ]; then
149149 echo " Virtual Environment is already activated."
150150 echo " Virtual Environment Home: ${VIRTUAL_ENV} "
151- else
152- source $PROJECT_FOLDER /venv/bin/activate
151+ echo " Trying to deactivate the virtual environment automatically."
152+
153+ # force deactivate the virtual environment
154+ if [ -n " ${_OLD_VIRTUAL_PATH:- } " ]
155+ then
156+ PATH=" ${_OLD_VIRTUAL_PATH:- } "
157+ export PATH
158+ unset _OLD_VIRTUAL_PATH
159+ fi
160+ if [ -n " ${_OLD_VIRTUAL_PYTHONHOME:- } " ]
161+ then
162+ PYTHONHOME=" ${_OLD_VIRTUAL_PYTHONHOME:- } "
163+ export PYTHONHOME
164+ unset _OLD_VIRTUAL_PYTHONHOME
165+ fi
166+ if [ -n " ${BASH:- } " -o -n " ${ZSH_VERSION:- } " ]
167+ then
168+ hash -r 2> /dev/null
169+ fi
170+ if [ -n " ${_OLD_VIRTUAL_PS1:- } " ]
171+ then
172+ PS1=" ${_OLD_VIRTUAL_PS1:- } "
173+ export PS1
174+ unset _OLD_VIRTUAL_PS1
175+ fi
176+ unset VIRTUAL_ENV
177+ unset VIRTUAL_ENV_PROMPT
178+ if [ ! " ${1:- } " = " nondestructive" ]
179+ then
180+ # deactivate always useless here
181+ # unset -f deactivate
182+ fi
153183 fi
184+
185+ source $PROJECT_FOLDER /venv/bin/activate
154186fi
Original file line number Diff line number Diff line change 234234 " python3.12" ,
235235 " python" ,
236236 ],
237- "default" : " python3.12 "
237+ "default" : " python "
238238 }
239239 ]
240240}
You can’t perform that action at this time.
0 commit comments