-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
42 lines (38 loc) · 1.35 KB
/
setup.ps1
File metadata and controls
42 lines (38 loc) · 1.35 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
# ============================================
# Personal IDE — Setup Script (Windows PowerShell)
#
# Usage: .\setup.ps1
# Or: powershell -ExecutionPolicy Bypass -File setup.ps1
# ============================================
$ErrorActionPreference = "Stop"
Write-Host ""
Write-Host " Personal IDE - Setup" -ForegroundColor Cyan
Write-Host " ===================" -ForegroundColor Cyan
Write-Host ""
# Check Node.js
try {
$nodeVersion = (node --version 2>&1)
$nodeMajor = [int]($nodeVersion -replace 'v(\d+)\..*', '$1')
if ($nodeMajor -lt 20) {
Write-Host "X Node.js $nodeVersion is too old. Please install Node.js 20+." -ForegroundColor Red
Write-Host " Download: https://nodejs.org/" -ForegroundColor Yellow
exit 1
}
Write-Host "OK Node.js $nodeVersion" -ForegroundColor Green
} catch {
Write-Host "X Node.js not found. Please install Node.js 20+ from https://nodejs.org/" -ForegroundColor Red
exit 1
}
# Check/install pnpm
try {
$pnpmVersion = (pnpm --version 2>&1)
Write-Host "OK pnpm $pnpmVersion" -ForegroundColor Green
} catch {
Write-Host ".. pnpm not found. Installing..." -ForegroundColor Yellow
npm install -g pnpm
$pnpmVersion = (pnpm --version 2>&1)
Write-Host "OK pnpm $pnpmVersion installed" -ForegroundColor Green
}
# Run the full setup script
Write-Host ""
node scripts/setup.js