-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-clean-test.bat
More file actions
85 lines (67 loc) · 2.29 KB
/
Copy pathdev-clean-test.bat
File metadata and controls
85 lines (67 loc) · 2.29 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@echo off
setlocal enabledelayedexpansion
REM Full clean test: scrub configs, ffmpeg, versions, rebuild everything, deploy, launch.
REM Run from the owlcms-controlpanel directory.
set "PANEL_DIR=%APPDATA%\owlcms-controlpanel"
set "CAMERAS_DIR=%APPDATA%\owlcms-cameras"
set "REPLAYS_DIR=%APPDATA%\owlcms-replays"
set "GIT_DIR=C:\Dev\git"
set "REPLAYS_SRC=%GIT_DIR%\replays"
set "PANEL_SRC=%GIT_DIR%\owlcms-controlpanel"
set "DEV_VERSION=0.0.0-dev"
echo === 1. Scrubbing installed state ===
echo Removing video_config (ffmpeg.toml, shared configs)...
if exist "%PANEL_DIR%\video_config" rd /s /q "%PANEL_DIR%\video_config"
echo Removing downloaded ffmpeg...
if exist "%PANEL_DIR%\ffmpeg" rd /s /q "%PANEL_DIR%\ffmpeg"
echo Removing cameras versions...
if exist "%CAMERAS_DIR%" rd /s /q "%CAMERAS_DIR%"
echo Removing replays versions...
if exist "%REPLAYS_DIR%" rd /s /q "%REPLAYS_DIR%"
echo.
echo === 2. Building replays binaries ===
pushd "%REPLAYS_SRC%"
if errorlevel 1 (
echo ERROR: Cannot cd to %REPLAYS_SRC%
exit /b 1
)
echo Building cameras_windows.exe...
go build -buildvcs=false -o cameras_windows.exe ./cmd/cameras
if errorlevel 1 (
echo ERROR: cameras build failed
popd
exit /b 1
)
echo Building replays_windows.exe...
go build -buildvcs=false -o replays_windows.exe ./cmd/replays
if errorlevel 1 (
echo ERROR: replays build failed
popd
exit /b 1
)
popd
echo.
echo === 3. Building control panel ===
pushd "%PANEL_SRC%"
go build -buildvcs=false -o controlpanel.exe .
if errorlevel 1 (
echo ERROR: control panel build failed
popd
exit /b 1
)
popd
echo.
echo === 4. Creating version dirs and deploying dev binaries ===
set "CAMERAS_VER_DIR=%CAMERAS_DIR%\%DEV_VERSION%"
set "REPLAYS_VER_DIR=%REPLAYS_DIR%\%DEV_VERSION%"
if not exist "%CAMERAS_VER_DIR%" mkdir "%CAMERAS_VER_DIR%"
if not exist "%REPLAYS_VER_DIR%" mkdir "%REPLAYS_VER_DIR%"
copy /y "%REPLAYS_SRC%\cameras_windows.exe" "%CAMERAS_VER_DIR%\cameras_windows.exe" >nul
copy /y "%REPLAYS_SRC%\replays_windows.exe" "%REPLAYS_VER_DIR%\replays_windows.exe" >nul
echo Deployed cameras to %CAMERAS_VER_DIR%\
echo Deployed replays to %REPLAYS_VER_DIR%\
echo.
echo === 5. Launching control panel ===
echo (ffmpeg download, config extraction, and launch will happen from the UI)
echo.
"%PANEL_SRC%\controlpanel.exe"