@@ -46,13 +46,11 @@ set VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz
4646set CFG_ROOT_DIR = %~dp0
4747set " CFG_BIN_DIR = %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \Scripts"
4848
49-
5049@ rem ################################
5150@ 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%
5352@ rem ################################
5453
55-
5654@ rem ################################
5755@ rem # Set the quiet flag to empty if not defined
5856if not defined CFG_QUIET (
@@ -83,15 +81,14 @@ if not "%1" == "" (
8381
8482set " PIP_EXTRA_ARGS = %PIP_EXTRA_ARGS% %NO_INDEX% "
8583
86-
8784@ rem ################################
8885@ rem # find a proper Python to run
8986@ rem # Use environment variables or a file if available.
9087@ rem # Otherwise the latest Python by default.
9188if not defined PYTHON_EXECUTABLE (
9289 @ 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"
9592 ) else (
9693 set " PYTHON_EXECUTABLE = py"
9794 )
@@ -103,22 +100,22 @@ if not defined PYTHON_EXECUTABLE (
103100@ rem # presence is not consistent across Linux distro and sometimes pip is not
104101@ rem # included either by default. The virtualenv.pyz app cures all these issues.
105102
106- if not exist " " %CFG_BIN_DIR% \python.exe" " (
103+ if not exist " %CFG_BIN_DIR% \python.exe" (
107104 if not exist " %CFG_BIN_DIR% " (
108- mkdir %CFG_BIN_DIR%
105+ mkdir " %CFG_BIN_DIR% "
109106 )
110107
111- if exist " " %CFG_ROOT_DIR% \etc\thirdparty\virtualenv.pyz" " (
108+ if exist " %CFG_ROOT_DIR% \etc\thirdparty\virtualenv.pyz" (
112109 %PYTHON_EXECUTABLE% " %CFG_ROOT_DIR% \etc\thirdparty\virtualenv.pyz" ^
113110 --wheel embed --pip embed --setuptools embed ^
114111 --seeder pip ^
115112 --never-download ^
116113 --no-periodic-update ^
117114 --no-vcs-ignore ^
118115 %CFG_QUIET% ^
119- %CFG_ROOT_DIR% \%VIRTUALENV_DIR%
116+ " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% "
120117 ) else (
121- if not exist " " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \virtualenv.pyz" " (
118+ if not exist " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \virtualenv.pyz" (
122119 curl -o " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \virtualenv.pyz" %VIRTUALENV_PYZ_URL%
123120
124121 if %ERRORLEVEL% neq 0 (
@@ -132,10 +129,11 @@ if not exist ""%CFG_BIN_DIR%\python.exe"" (
132129 --no-periodic-update ^
133130 --no-vcs-ignore ^
134131 %CFG_QUIET% ^
135- %CFG_ROOT_DIR% \%VIRTUALENV_DIR%
132+ " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% "
136133 )
137134)
138135
136+
139137if %ERRORLEVEL% neq 0 (
140138 exit /b %ERRORLEVEL%
141139)
@@ -148,7 +146,7 @@ if %ERRORLEVEL% neq 0 (
148146@ rem # speeds up the installation.
149147@ rem # We always have the PEP517 build dependencies installed already.
150148
151- %CFG_BIN_DIR% \pip install ^
149+ " %CFG_BIN_DIR% \pip" install ^
152150 --upgrade ^
153151 --no-build-isolation ^
154152 %CFG_QUIET% ^
@@ -159,7 +157,7 @@ if %ERRORLEVEL% neq 0 (
159157if exist " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \bin" (
160158 rmdir /s /q " %CFG_ROOT_DIR% \%VIRTUALENV_DIR% \bin"
161159)
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"
163161
164162if %ERRORLEVEL% neq 0 (
165163 exit /b %ERRORLEVEL%
0 commit comments