-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-reset-apps.bat
More file actions
61 lines (49 loc) · 1.61 KB
/
Copy pathdev-reset-apps.bat
File metadata and controls
61 lines (49 loc) · 1.61 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
@echo off
setlocal
REM Apps-only dev helper: reset app versions, build cameras/replays, deploy dev binaries.
REM Leaves control panel files and binary untouched.
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 "DEV_VERSION=0.0.0-dev"
echo === 1. Resetting app installed state ===
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 app 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. Deploying app 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 Apps-only reset/build/deploy complete.
exit /b 0