Update run.bat (#3783)

Co-authored-by: Richard Beales <rich@richbeales.net>
pull/3752/head^2
itsmarble 2023-05-04 19:55:58 +02:00 committed by GitHub
parent fad24b3525
commit ad8b8cb9eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 4 deletions

22
run.bat
View File

@ -1,8 +1,24 @@
@echo off
python scripts/check_requirements.py requirements.txt
setlocal enabledelayedexpansion
:FindPythonCommand
for %%A in (python python3) do (
where /Q %%A
if !errorlevel! EQU 0 (
set "PYTHON_CMD=%%A"
goto :Found
)
)
echo Python not found. Please install Python.
pause
exit /B 1
:Found
%PYTHON_CMD% scripts/check_requirements.py requirements.txt
if errorlevel 1 (
echo Installing missing packages...
pip install -r requirements.txt
%PYTHON_CMD% -m pip install -r requirements.txt
)
python -m autogpt %*
%PYTHON_CMD% -m autogpt %*
pause