Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update start_windows.cmd #81

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions start_windows.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ if %errorlevel% neq 0 (
exit /b 1
)

:: Set default branch to main if needed
git config --get-regexp init.defaultBranch | findstr /i "main" >nul 2>nul
if %errorlevel% neq 0 (
git config --global init.defaultBranch main
)

:: Check if Python and pip are installed
where python >nul 2>nul
if %errorlevel% neq 0 (
Expand All @@ -35,7 +41,7 @@ if %errorlevel% neq 0 (
echo ==========================================
echo Press CTRL+C to stop the bot
echo ==========================================
timeout /t 3
timeout /t 3 /nobreak

:loop
:: Update the bot
Expand All @@ -45,19 +51,19 @@ echo ==========================================
git pull origin main
if %errorlevel% neq 0 (
echo Failed to update the bot. Retrying in 5 seconds...
timeout /t 5
timeout /t 5 /nobreak
goto loop
)
echo Project updated successfully
timeout /t 2
timeout /t 2 /nobreak

echo ==========================================
echo Updating dependencies...
echo ==========================================
%python_alias% -m pip install -r requirements.txt >nul 2>nul
%python_alias% -m pip install -U -r requirements.txt >nul 2>nul
if %errorlevel% neq 0 (
echo Failed to update dependencies. Retrying in 5 seconds...
timeout /t 5
timeout /t 5 /nobreak
goto loop
)
echo Dependencies updated successfully
Expand All @@ -72,7 +78,7 @@ if %errorlevel% neq 0 (
) else (
echo Bot stopped. Restarting in 5 seconds...
)
timeout /t 5
timeout /t 5 /nobreak
goto loop

:ctrlc
Expand Down