-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
39 lines (33 loc) · 929 Bytes
/
setup.bat
File metadata and controls
39 lines (33 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
setlocal enabledelayedexpansion
:: Update checker
echo Checking for updates
git fetch
for /f %%i in ('git rev-parse @') do set LOCAL=%%i
for /f %%i in ('git rev-parse @{u}') do set REMOTE=%%i
for /f %%i in ('git merge-base @ @{u}') do set BASE=%%i
if "%LOCAL%" == "%REMOTE%" (
echo Up to date
) else if "%LOCAL%" == "%BASE%" (
echo Update found
python3 src/updater.py
set PY_RET=%ERRORLEVEL%
if "!PY_RET!" == "0" (
echo Downloading update
git pull
) else if "!PY_RET!" == "1" (
echo Skipping update
) else if "!PY_RET!" == "2" (
echo Operation cancelled
exit /b 0
)
) else (
echo Local is ahead of remote, skipping update check
)
:: Init
echo Attempting creation of virtual environment
python3 -m venv venv
call .\venv\Scripts\activate
echo Upgrading dependencies
pip3 install --upgrade --verbose -r requirements.txt
python3 src/main.py