From 40e91f2b72b96f14bc177d382f24d5fd9dcbcb7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20=C5=9Eafak?= <39929354+denizsafak@users.noreply.github.com> Date: Fri, 15 Mar 2024 02:01:57 +0300 Subject: [PATCH] Add files via upload --- run.bat | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/run.bat b/run.bat index 7a466c8..99046c1 100644 --- a/run.bat +++ b/run.bat @@ -44,11 +44,16 @@ echo Activating virtual environment... call %ACTIVATE_PATH% echo Checking the requirements... -for /f "delims=" %%i in (%requirementsFile%) do ( - pip freeze | findstr /c:%%i > nul - if errorlevel 1 ( - echo Installing package: %%i - pip install %%i --upgrade --quiet +:: Get the list of installed packages using pip freeze +for /f "tokens=1,* delims==" %%i in ('pip freeze') do ( + set installed[%%i]=%%j +) + +:: Compare with the requirements from the requirements.txt file +for /f "tokens=1,* delims==" %%i in (%requirementsFile%) do ( + if not "!installed[%%i]!"=="%%j" ( + echo Installing package: %%i==%%j + pip install %%i==%%j --upgrade --quiet ) )