From 9b839eb6c397649e76e9d4ae0d3de17abb4889db Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Sat, 15 Jul 2023 20:10:26 +0200 Subject: [PATCH] enhanced --- win_run.bat | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/win_run.bat b/win_run.bat index 86a58a35..aad88b13 100644 --- a/win_run.bat +++ b/win_run.bat @@ -57,6 +57,35 @@ if "%git_status%" == "" ( REM Clean up the temporary file del git_status.txt +REM Check for library upgrades in requirements.txt +pip list --outdated > outdated_libraries.txt + +REM Read the outdated library information from the file +setlocal enabledelayedexpansion +set "outdated_libraries=" +for /f "skip=2 tokens=1,3" %%a in (outdated_libraries.txt) do ( + set "outdated_libraries=!outdated_libraries!%%a " +) +endlocal & set "outdated_libraries=%outdated_libraries%" + +REM Prompt the user to update libraries if there are upgrades available +if "%outdated_libraries%" == "" ( + echo No library upgrades available. +) else ( + echo Upgrades are available for the following libraries: %outdated_libraries% + echo Do you want to update the libraries? (y/n) + set /p library_choice= + if /i "%library_choice%"=="y" ( + pip install --upgrade -r requirements.txt + echo Libraries have been updated successfully. + ) else ( + echo Skipping the library updates. + ) +) + +REM Clean up the temporary library information file +del outdated_libraries.txt + @rem set default cuda toolkit to the one in the environment set "CUDA_PATH=%INSTALL_ENV_DIR%"