py_projects/projects/GetRequirements.bat

44 lines
815 B
Batchfile
Raw Normal View History

2024-01-17 10:23:07 +00:00
@echo off
setlocal EnableDelayedExpansion
set "RESET="
set "BLUE="
set "GREEN="
set "RED="
set "YELLOW="
set "WHITE="
echo %BLUE%Get Requirements%RESET%
@REM is python installed?
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo "python not installed"
winget install -e --id Python.Python
echo %RED%Try launching this script again%RESET%
pause
exit /b 1
)
echo %GREEN%Python installed%RESET%
@REM is pip installed?
pip --version >nul 2>&1
if %errorlevel% neq 0 (
echo "pip not installed"
2024-01-24 18:05:08 +00:00
pause
2024-01-17 10:23:07 +00:00
exit /b 1
)
echo %GREEN%Pip installed%RESET%
@REM check if requirements.txt exists
if not exist "requirements.txt" (
echo "requirements.txt not found"
2024-01-24 18:05:08 +00:00
pause
2024-01-17 10:23:07 +00:00
exit /b 1
)
set "file=requirements.txt"
pip install -r %file%
pause