Repository navigation
Expand file tree
/
Copy pathrun.bat
More file actions
57 lines (49 loc) · 1.51 KB
/
Copy pathrun.bat
File metadata and controls
57 lines (49 loc) · 1.51 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
@echo off
setlocal enabledelayedexpansion
title Vidur Sales OS - Runner
cd /d "%~dp0"
echo ===================================================
echo VIDUR SALES OS
echo ===================================================
echo.
:: 1. Check Node.js installation
echo [*] Checking Node.js installation...
where node >nul 2>nul
if %errorlevel% neq 0 (
echo [!] Node.js is not installed or not found in PATH!
echo Please install Node.js from https://nodejs.org/
echo.
pause
exit /b 1
)
for /f "tokens=*" %%v in ('node -v') do set NODE_VER=%%v
echo [*] Detected Node.js: %NODE_VER%
:: 2. Check dependencies (node_modules)
if not exist "node_modules\" (
echo [*] 'node_modules' folder not found. Installing dependencies...
call npm.cmd install
if %errorlevel% neq 0 (
echo.
echo [!] Failed to install dependencies. Check your internet connection or npm setup.
pause
exit /b %errorlevel%
)
echo [*] Dependencies installed successfully.
) else (
echo [*] Dependencies already installed.
)
:: 3. Launch browser in the background
echo.
echo [*] Opening application in browser (http://localhost:3000)...
start "" "http://localhost:3000"
:: 4. Start Vite development server
echo [*] Starting Vite development server...
echo Press Ctrl+C to stop the server anytime.
echo.
echo ===================================================
call npm.cmd run dev
if %errorlevel% neq 0 (
echo.
echo [!] Vite server exited with error code %errorlevel%.
pause
)