-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
22 lines (18 loc) · 806 Bytes
/
build.ps1
File metadata and controls
22 lines (18 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# RTSPanda — single-binary build (frontend + backend). Run from repo root.
$ErrorActionPreference = "Stop"
$WebEmbedDir = "backend\internal\api\web"
Write-Host "Building frontend..."
Set-Location frontend
npm run build
Set-Location ..
Write-Host "Copying frontend/dist to backend for embed..."
if (Test-Path $WebEmbedDir) { Remove-Item -Recurse -Force $WebEmbedDir }
New-Item -ItemType Directory -Force -Path $WebEmbedDir | Out-Null
Copy-Item -Path "frontend\dist\*" -Destination $WebEmbedDir -Recurse -Force
# Preserve .gitkeep so the directory is tracked when empty
New-Item -ItemType File -Path "$WebEmbedDir\.gitkeep" -Force | Out-Null
Write-Host "Building Go binary..."
Set-Location backend
go build -o rtspanda.exe ./cmd/rtspanda
Set-Location ..
Write-Host "Done. Binary: backend\rtspanda.exe"