Repository navigation
Expand file tree
/
Copy pathrun.ps1
More file actions
47 lines (40 loc) · 1.86 KB
/
Copy pathrun.ps1
File metadata and controls
47 lines (40 loc) · 1.86 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
# Vidur Sales OS - PowerShell Runner Script
$Host.UI.RawUI.WindowTitle = "Vidur Sales OS - Runner"
Set-Location -Path $PSScriptRoot
Write-Host "===================================================" -ForegroundColor Cyan
Write-Host " VIDUR SALES OS " -ForegroundColor Cyan
Write-Host "===================================================" -ForegroundColor Cyan
Write-Host ""
# 1. Check Node.js
Write-Host "[*] Checking Node.js installation..." -ForegroundColor Yellow
$nodePath = Get-Command node -ErrorAction SilentlyContinue
if (-not $nodePath) {
Write-Host "[!] Node.js is not installed or not found in PATH!" -ForegroundColor Red
Write-Host " Please install Node.js from https://nodejs.org/" -ForegroundColor Red
Read-Host "Press Enter to exit..."
exit 1
}
$nodeVersion = & node -v
Write-Host "[*] Detected Node.js: $nodeVersion" -ForegroundColor Green
# 2. Check dependencies
if (-not (Test-Path -Path "node_modules")) {
Write-Host "[*] 'node_modules' not found. Installing dependencies..." -ForegroundColor Yellow
& npm.cmd install
if ($LASTEXITCODE -ne 0) {
Write-Host "[!] Dependency installation failed." -ForegroundColor Red
Read-Host "Press Enter to exit..."
exit $LASTEXITCODE
}
Write-Host "[*] Dependencies installed successfully." -ForegroundColor Green
} else {
Write-Host "[*] Dependencies already installed." -ForegroundColor Green
}
# 3. Open browser
Write-Host ""
Write-Host "[*] Opening application in browser (http://localhost:3000)..." -ForegroundColor Cyan
Start-Process "http://localhost:3000"
# 4. Start Vite Dev Server
Write-Host "[*] Starting Vite development server..." -ForegroundColor Green
Write-Host " Press Ctrl+C to stop the server." -ForegroundColor Gray
Write-Host "===================================================" -ForegroundColor Cyan
& npm.cmd run dev