-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
82 lines (67 loc) · 1.68 KB
/
build.bat
File metadata and controls
82 lines (67 loc) · 1.68 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
@echo off
REM Torrentarr Build Script for Windows
REM This script builds both the React frontend and .NET backend
setlocal enabledelayedexpansion
echo =========================================
echo Torrentarr Build Script (Windows)
echo =========================================
echo.
REM Check prerequisites
echo Checking prerequisites...
where dotnet >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo Error: .NET SDK not found. Please install .NET 10.0 or later.
exit /b 1
)
where node >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo Error: Node.js not found. Please install Node.js 18 or later.
exit /b 1
)
echo [92m✓ Prerequisites met[0m
echo.
REM Build frontend
echo Building React frontend...
cd webui
if not exist "node_modules" (
echo Installing npm dependencies...
call npm install
if %ERRORLEVEL% NEQ 0 (
echo [91m✗ npm install failed[0m
exit /b 1
)
)
echo Building production bundle...
call npm run build
if %ERRORLEVEL% NEQ 0 (
echo [91m✗ Frontend build failed[0m
exit /b 1
)
echo [92m✓ Frontend build successful[0m
cd ..
echo.
REM Build backend
echo Building .NET backend...
dotnet restore
if %ERRORLEVEL% NEQ 0 (
echo [91m✗ dotnet restore failed[0m
exit /b 1
)
dotnet build -c Release
if %ERRORLEVEL% NEQ 0 (
echo [91m✗ Backend build failed[0m
exit /b 1
)
echo [92m✓ Backend build successful[0m
echo.
echo [92m==========================================[0m
echo [92m Build Complete![0m
echo [92m==========================================[0m
echo.
echo Run the application:
echo dotnet run --project src\Torrentarr.Host\Torrentarr.Host.csproj -c Release
echo.
echo Or use Docker:
echo docker-compose up -d
echo.
endlocal