-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
64 lines (54 loc) · 1.59 KB
/
Copy pathstart.bat
File metadata and controls
64 lines (54 loc) · 1.59 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
@echo off
chcp 65001 >nul
SETLOCAL EnableDelayedExpansion
title Poster Resume Editor
echo.
echo ========================================================
echo.
echo --- Poster Resume Editor ---
echo.
echo Current project: %CD%
echo.
echo ========================================================
echo.
:: Check Node.js
where node >nul 2>nul
if %ERRORLEVEL% neq 0 (
echo [ERROR] Node.js not found!
echo Please install Node.js from https://nodejs.org/
pause
exit /b
)
echo [*] Initializing Engine...
if not exist "node_modules\vite\package.json" (
echo [!] Installing dependencies, please wait...
call npm install
) else (
echo [v] Engine core is ready.
)
:: Create a Git-ignored local environment file. Never write secrets to the tracked .env.
if not exist ".env.local" (
if exist ".env.example" (
copy .env.example .env.local >nul
echo [v] Local environment initialized.
)
)
echo.
echo ========================================================
echo Launch Success! Starting browser...
echo Server will run on: http://127.0.0.1:5173
echo ========================================================
echo.
:: Kill any existing processes on port 5173
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":5173"') do (
taskkill /F /PID %%a >nul 2>&1
)
:: Open the exact IPv4 endpoint so an old localhost or IPv6 service cannot win.
start "" http://127.0.0.1:5173/?build=editorial-v2
call npm run dev -- --host 127.0.0.1 --port 5173 --strictPort
if %ERRORLEVEL% neq 0 (
echo.
echo [!] Launch failed. Try deleting node_modules and restart.
echo.
)
pause