@@ -46,13 +46,11 @@ set VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz
46
46
set CFG_ROOT_DIR = %~dp0
47
47
set " CFG_BIN_DIR = %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \Scripts"
48
48
49
-
50
49
@ rem ################################
51
50
@ rem # Thirdparty package locations and index handling
52
- set " PIP_EXTRA_ARGS = --find-links %CFG_ROOT_DIR% \thirdparty --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
51
+ set " PIP_EXTRA_ARGS = --find-links " %CFG_ROOT_DIR% \thirdparty" --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
53
52
@ rem ################################
54
53
55
-
56
54
@ rem ################################
57
55
@ rem # Set the quiet flag to empty if not defined
58
56
if not defined CFG_QUIET (
@@ -83,15 +81,14 @@ if not "%1" == "" (
83
81
84
82
set " PIP_EXTRA_ARGS = %PIP_EXTRA_ARGS% %NO_INDEX% "
85
83
86
-
87
84
@ rem ################################
88
85
@ rem # find a proper Python to run
89
86
@ rem # Use environment variables or a file if available.
90
87
@ rem # Otherwise the latest Python by default.
91
88
if not defined PYTHON_EXECUTABLE (
92
89
@ rem # check for a file named PYTHON_EXECUTABLE
93
- if exist " " %CFG_ROOT_DIR% \PYTHON_EXECUTABLE" " (
94
- set /p PYTHON_EXECUTABLE = < " " %CFG_ROOT_DIR% \PYTHON_EXECUTABLE" "
90
+ if exist " %CFG_ROOT_DIR% \PYTHON_EXECUTABLE" (
91
+ set /p PYTHON_EXECUTABLE = < " %CFG_ROOT_DIR% \PYTHON_EXECUTABLE"
95
92
) else (
96
93
set " PYTHON_EXECUTABLE = py"
97
94
)
@@ -103,22 +100,22 @@ if not defined PYTHON_EXECUTABLE (
103
100
@ rem # presence is not consistent across Linux distro and sometimes pip is not
104
101
@ rem # included either by default. The virtualenv.pyz app cures all these issues.
105
102
106
- if not exist " " %CFG_BIN_DIR% \python.exe" " (
103
+ if not exist " %CFG_BIN_DIR% \python.exe" (
107
104
if not exist " %CFG_BIN_DIR% " (
108
- mkdir %CFG_BIN_DIR%
105
+ mkdir " %CFG_BIN_DIR% "
109
106
)
110
107
111
- if exist " " %CFG_ROOT_DIR% \etc\thirdparty\virtualenv.pyz" " (
108
+ if exist " %CFG_ROOT_DIR% \etc\thirdparty\virtualenv.pyz" (
112
109
%PYTHON_EXECUTABLE% " %CFG_ROOT_DIR% \etc\thirdparty\virtualenv.pyz" ^
113
110
--wheel embed --pip embed --setuptools embed ^
114
111
--seeder pip ^
115
112
--never-download ^
116
113
--no-periodic-update ^
117
114
--no-vcs-ignore ^
118
115
%CFG_QUIET% ^
119
- %CFG_ROOT_DIR% \%VIRTUALENV_DIR%
116
+ " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% "
120
117
) else (
121
- if not exist " " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \virtualenv.pyz" " (
118
+ if not exist " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \virtualenv.pyz" (
122
119
curl -o " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \virtualenv.pyz" %VIRTUALENV_PYZ_URL%
123
120
124
121
if %ERRORLEVEL% neq 0 (
@@ -132,10 +129,11 @@ if not exist ""%CFG_BIN_DIR%\python.exe"" (
132
129
--no-periodic-update ^
133
130
--no-vcs-ignore ^
134
131
%CFG_QUIET% ^
135
- %CFG_ROOT_DIR% \%VIRTUALENV_DIR%
132
+ " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% "
136
133
)
137
134
)
138
135
136
+
139
137
if %ERRORLEVEL% neq 0 (
140
138
exit /b %ERRORLEVEL%
141
139
)
@@ -148,7 +146,7 @@ if %ERRORLEVEL% neq 0 (
148
146
@ rem # speeds up the installation.
149
147
@ rem # We always have the PEP517 build dependencies installed already.
150
148
151
- %CFG_BIN_DIR% \pip install ^
149
+ " %CFG_BIN_DIR% \pip" install ^
152
150
--upgrade ^
153
151
--no-build-isolation ^
154
152
%CFG_QUIET% ^
@@ -159,7 +157,7 @@ if %ERRORLEVEL% neq 0 (
159
157
if exist " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \bin" (
160
158
rmdir /s /q " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \bin"
161
159
)
162
- mklink /J %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \bin %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \Scripts
160
+ mklink /J " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \bin" " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \Scripts"
163
161
164
162
if %ERRORLEVEL% neq 0 (
165
163
exit /b %ERRORLEVEL%
0 commit comments