-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
53 lines (45 loc) · 1.49 KB
/
Copy pathstart.bat
File metadata and controls
53 lines (45 loc) · 1.49 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@echo off
REM Start cull on Windows: update the repo, prep the venv, run the server.
setlocal enabledelayedexpansion
cd /d "%~dp0"
echo [cull] checking for updates...
git rev-parse --is-inside-work-tree >nul 2>&1
if !errorlevel! equ 0 (
git fetch --quiet
for /f %%i in ('git rev-list HEAD..@{u} --count 2^>nul') do set "BEHIND=%%i"
if "!BEHIND!"=="" (
echo [cull] no upstream tracking branch, skipping pull.
) else if "!BEHIND!"=="0" (
echo [cull] already up to date.
) else (
echo [cull] pulling !BEHIND! new commit^(s^)...
git pull --ff-only
)
) else (
echo [cull] not a git repo, skipping update.
)
where python >nul 2>&1
if !errorlevel! neq 0 (
echo [cull] ERROR: python not found on PATH. Install Python 3.11+ and retry.
pause
exit /b 1
)
if not exist "backend\.venv" (
echo [cull] creating virtual environment...
python -m venv "backend\.venv"
)
call "backend\.venv\Scripts\activate.bat"
echo [cull] installing/updating dependencies...
python -m pip install --quiet --upgrade pip
python -m pip install --quiet -r "backend\requirements.txt"
if not exist "config.yaml" (
echo [cull] no config.yaml found; copying config.example.yaml.
echo [cull] EDIT config.yaml so raw_dir points at your image folder, then rerun.
copy /y "config.example.yaml" "config.yaml" >nul
)
set "CULL_CONFIG=%cd%\config.yaml"
echo [cull] starting server on http://localhost:8080 ...
cd backend
python -m app.main
echo [cull] server stopped.
pause