@echo off rem is it started standalone? IF "%TARGET%" == "" GOTO usage if exist .\%TARGET%\%GITNAME%\ ( goto update ) else ( rem target does not exist, so we have to create it setlocal enableextensions mkdir .\%TARGET% endlocal git -C .\%TARGET% clone %URL% %GITNAME% if %errorlevel% == 0 ( cd .\%TARGET%\%GITNAME% goto checkvenv ) echo ERROR: Failed to clone git repository %URL% to %TARGET% goto end ) ) :usage echo ERROR: this batch should only be started as an include of another settings files goto end :update echo start update cd .\%TARGET%\%GITNAME% git pull goto checkvenv :checkvenv IF "%HASPYTHON%" NEQ "YES" GOTO end echo check for venv if exist .venv\ goto initpip echo create venv python -m venv .venv if %errorlevel% == 0 GOTO initpip echo ERROR: Failed to set up .venv directory goto end :initpip echo init pip .venv\Scripts\pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org truststore :updatepip IF EXIST requirements.txt ( .venv\Scripts\pip install -r requirements.txt --use-feature=truststore ) :end pause