Skip to content

Commit 0a99b1d

Browse files
committed
Update configure.bat
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent 9b8a6cc commit 0a99b1d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

configure.bat

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ set "DEV_REQUIREMENTS=--editable .[testing] --constraint requirements.txt --cons
3131
set "VIRTUALENV_DIR=venv"
3232

3333
@rem # Cleanable files and directories to delete with the --clean option
34-
set "CLEANABLE=build tmp bin Lib Scripts include venv"
34+
set "CLEANABLE=build venv"
3535

3636
@rem # extra arguments passed to pip
3737
set "PIP_EXTRA_ARGS= "
@@ -46,11 +46,14 @@ set VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz
4646
set CFG_ROOT_DIR=%~dp0
4747
set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"
4848

49+
4950
@rem ################################
50-
@rem # Thirdparty package locations and index handling
51-
set "PIP_EXTRA_ARGS=--find-links "%CFG_ROOT_DIR%\thirdparty" --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
52-
53-
@rem ################################
51+
@rem # Thirdparty package locations and index handling
52+
if exist "%CFG_ROOT_DIR%\thirdparty" (
53+
set PIP_EXTRA_ARGS=--find-links "%CFG_ROOT_DIR%\thirdparty"
54+
)
55+
set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
56+
5457

5558
@rem ################################
5659
@rem # Set the quiet flag to empty if not defined
@@ -82,6 +85,7 @@ if not "%1" == "" (
8285

8386
set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% %NO_INDEX%"
8487

88+
8589
@rem ################################
8690
@rem # find a proper Python to run
8791
@rem # Use environment variables or a file if available.
@@ -134,7 +138,6 @@ if not exist "%CFG_BIN_DIR%\python.exe" (
134138
)
135139
)
136140

137-
138141
if %ERRORLEVEL% neq 0 (
139142
exit /b %ERRORLEVEL%
140143
)
@@ -158,8 +161,7 @@ if %ERRORLEVEL% neq 0 (
158161
if exist "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" (
159162
rmdir /s /q "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin"
160163
)
161-
162-
mklink /J "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"
164+
mklink /J "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"
163165

164166
if %ERRORLEVEL% neq 0 (
165167
exit /b %ERRORLEVEL%
@@ -200,4 +202,4 @@ for %%F in (%CLEANABLE%) do (
200202
rmdir /s /q "%CFG_ROOT_DIR%\%%F" >nul 2>&1
201203
del /f /q "%CFG_ROOT_DIR%\%%F" >nul 2>&1
202204
)
203-
exit /b 0
205+
exit /b 0

0 commit comments

Comments
 (0)