-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.bat
More file actions
63 lines (51 loc) · 1.17 KB
/
Copy pathstart-dev.bat
File metadata and controls
63 lines (51 loc) · 1.17 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
@echo off
setlocal EnableExtensions
REM Mantener consola abierta al ejecutar con doble click
if /I not "%~1"=="--inner" (
cmd /k ""%~f0" --inner"
exit /b
)
shift /1
cd /d "%~dp0"
title JW-Serial - Desarrollo
echo ==================================================
echo JW-Serial ^| Modo desarrollo
echo ==================================================
echo.
where node >nul 2>&1
if errorlevel 1 (
echo [ERROR] Node.js no esta instalado o no esta en PATH.
echo Instala Node LTS desde: https://nodejs.org/
goto :fail
)
where npm >nul 2>&1
if errorlevel 1 (
echo [ERROR] npm no esta disponible en PATH.
echo Reinstala Node.js LTS.
goto :fail
)
echo [INFO] Ejecutando: npm install
call npm install
if errorlevel 1 (
echo.
echo [ERROR] npm install fallo. Revisa conectividad/permisos.
goto :fail
)
echo.
echo [INFO] Ejecutando: npm run dev
call npm run dev
set "DEV_EXIT=%ERRORLEVEL%"
if not "%DEV_EXIT%"=="0" (
echo.
echo [ERROR] npm run dev termino con codigo %DEV_EXIT%.
goto :fail_with_code
)
goto :end
:fail_with_code
echo [FAIL] El proceso termino con error.
exit /b %DEV_EXIT%
:fail
echo [FAIL] El proceso termino con error.
exit /b 1
:end
exit /b 0