Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactoring to show logic better

  • Loading branch information...
commit 549bbf6d150df82abfc19067b867ef2376fa821d 1 parent c75e9ef
@piotr-dobrogost piotr-dobrogost authored
View
20 virtualenv_embedded/activate.bat
@@ -1,32 +1,26 @@
@echo off
set "VIRTUAL_ENV=__VIRTUAL_ENV__"
-if not defined PROMPT (
- set "PROMPT=$P$G"
-)
-
if defined _OLD_VIRTUAL_PROMPT (
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
+) else (
+ if not defined PROMPT (
+ set "PROMPT=$P$G"
+ )
+ set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
)
-
-if defined _OLD_VIRTUAL_PYTHONHOME (
- set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
-)
-
-set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
set "PROMPT=__VIRTUAL_WINPROMPT__ %PROMPT%"
-if defined PYTHONHOME (
+if not defined _OLD_VIRTUAL_PYTHONHOME (
set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
- set PYTHONHOME=
)
+set PYTHONHOME=
if defined _OLD_VIRTUAL_PATH (
set "PATH=%_OLD_VIRTUAL_PATH%"
) else (
set "_OLD_VIRTUAL_PATH=%PATH%"
)
-
set "PATH=%VIRTUAL_ENV%\__BIN_NAME__;%PATH%"
:END
View
4 virtualenv_embedded/deactivate.bat
@@ -2,8 +2,8 @@
if defined _OLD_VIRTUAL_PROMPT (
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
+ set _OLD_VIRTUAL_PROMPT=
)
-set _OLD_VIRTUAL_PROMPT=
if defined _OLD_VIRTUAL_PYTHONHOME (
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
@@ -12,7 +12,7 @@ if defined _OLD_VIRTUAL_PYTHONHOME (
if defined _OLD_VIRTUAL_PATH (
set "PATH=%_OLD_VIRTUAL_PATH%"
+ set _OLD_VIRTUAL_PATH=
)
-set _OLD_VIRTUAL_PATH=
:END
Please sign in to comment.
Something went wrong with that request. Please try again.