-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathstart.bat
More file actions
56 lines (50 loc) · 1.14 KB
/
Copy pathstart.bat
File metadata and controls
56 lines (50 loc) · 1.14 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
@echo off
title ReSplat Local
echo.
echo ReSplat Local Backend
echo =====================
echo.
:: Check Node.js
where node >nul 2>nul
if %errorlevel% neq 0 (
echo [ERROR] Node.js is not installed.
echo Please install Node.js ^>= 20.19.0 from https://nodejs.org/
echo.
pause
exit /b 1
)
:: Check Node.js version
for /f "tokens=1,2,3 delims=." %%a in ('node -v 2^>nul') do (
set NODE_MAJOR=%%a
set NODE_MINOR=%%b
)
set NODE_MAJOR=%NODE_MAJOR:v=%
if %NODE_MAJOR% lss 20 (
echo [WARN] Node.js version %NODE_MAJOR%.%NODE_MINOR% detected. Recommended: ^>= 20.19.0
echo.
)
:: Install dependencies if needed
if not exist "node_modules" (
echo Installing dependencies...
call npm install
if %errorlevel% neq 0 (
echo [ERROR] npm install failed.
pause
exit /b 1
)
)
:: Build frontend if dist/ doesn't exist
if not exist "dist\index.html" (
echo Building frontend...
call npm run build
if %errorlevel% neq 0 (
echo [ERROR] Build failed.
pause
exit /b 1
)
)
:: Start server
echo Starting ReSplat backend...
echo.
call npm run local
pause