Repository navigation
Expand file tree
/
Copy pathdebug.bat
More file actions
69 lines (54 loc) · 1.42 KB
/
Copy pathdebug.bat
File metadata and controls
69 lines (54 loc) · 1.42 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
@echo off
:: Re-launch with stdin redirected from nul so pressing Ctrl+C exits
:: immediately without the "Terminate batch job (Y/N)?" prompt.
if not defined _PSM_NOPROMPT (
set "_PSM_NOPROMPT=1"
call "%~f0" %* <nul
exit /b %errorlevel%
)
setlocal enabledelayedexpansion
echo ========================================
echo PalWorld Server Manager - Debug Script
echo ========================================
echo.
:: Save the root directory
set ROOT_DIR=%cd%
echo [1/4] Cleaning frontend build directories...
echo.
cd ui
if errorlevel 1 (
echo Error: Cannot change to ui directory
exit /b 1
)
if exist "out" (
echo Removing ui/out...
rmdir /s /q "out"
)
if exist ".next" (
echo Removing ui/.next...
rmdir /s /q ".next"
)
echo.
echo [2/4] Building frontend...
echo.
call bun run build
if errorlevel 1 (
echo.
echo Error: Frontend build failed
cd "%ROOT_DIR%"
exit /b 1
)
echo.
echo [3/4] Returning to root directory...
cd "%ROOT_DIR%"
echo.
echo [4/4] Starting Go backend...
echo.
echo Press Ctrl+C to stop the server
echo ========================================
echo.
go build -trimpath -ldflags "-s -w -X main.Version=v0.0.1" -o palsm.exe .
:: Open the management UI in the default browser once the server is up.
:: This is a debug convenience only; the tool itself never opens a browser.
start "" /b cmd /c "timeout /t 3 /nobreak >nul & start "" http://127.0.0.1:8080/"
.\palsm.exe