Files
plantplan/bin/client.bat
2026-04-16 13:34:05 +02:00

75 lines
1.7 KiB
Batchfile

@echo off
REM ================================================================
REM PLANTPLAN - Client (Vite Dev-Server) verwalten
REM Verwendung: client.bat [start|stop|reload|status]
REM ================================================================
call "%~dp0setenv.bat"
if "%1"=="" goto usage
if /i "%1"=="start" goto start
if /i "%1"=="stop" goto stop
if /i "%1"=="reload" goto reload
if /i "%1"=="status" goto status
goto usage
:start
echo Starting PlantPlan Client (Vite) ...
REM Pruefen ob Client bereits laeuft
tasklist /FI "WINDOWTITLE eq PlantPlan-Client" 2>nul | find /i "cmd.exe" >nul
if not errorlevel 1 (
echo Client laeuft bereits!
goto end
)
REM Pruefen ob node_modules existiert
if not exist "%PV_CLIENT%\node_modules" (
echo FEHLER: node_modules nicht gefunden! Bitte zuerst install_npm.bat ausfuehren.
goto end
)
start "PlantPlan-Client" cmd /k "cd /d "%PV_CLIENT%" && npm run dev"
echo Client gestartet auf %PV_CLIENT_URL%
goto end
:stop
echo Stopping PlantPlan Client ...
taskkill /FI "WINDOWTITLE eq PlantPlan-Client" /T /F >nul 2>&1
if errorlevel 1 (
echo Client war nicht gestartet.
) else (
echo Client gestoppt.
)
goto end
:reload
echo Reloading PlantPlan Client ...
call :stop
timeout /t 2 /nobreak >nul
call :start
goto end
:status
tasklist /FI "WINDOWTITLE eq PlantPlan-Client" 2>nul | find /i "cmd.exe" >nul
if not errorlevel 1 (
echo Client: LAEUFT
) else (
echo Client: GESTOPPT
)
goto end
:usage
echo.
echo Verwendung: client.bat [start^|stop^|reload^|status]
echo.
echo start - Client starten (Vite Dev-Server)
echo stop - Client stoppen
echo reload - Client neu starten
echo status - Pruefen ob Client laeuft
echo.
:end