Skip to content

Commit dab2cc6

Browse files
author
Mohammod Al Amin Ashik
committed
Fix setup script compatibility
1 parent c7b5095 commit dab2cc6

1 file changed

Lines changed: 21 additions & 49 deletions

File tree

scripts/setup-dev.ps1

Lines changed: 21 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,20 @@ param(
88
[switch]$SkipTauriDriver
99
)
1010

11-
$ErrorActionPreference = "Stop"
12-
1311
Write-Host "=== McpMux Dev Setup ===" -ForegroundColor Cyan
1412

1513
# Check prerequisites
1614
Write-Host "`nChecking prerequisites..." -ForegroundColor Yellow
1715

18-
$missing = @()
19-
20-
if (-not (Get-Command "node" -ErrorAction SilentlyContinue)) {
21-
$missing += "Node.js (https://nodejs.org/)"
22-
}
23-
24-
if (-not (Get-Command "pnpm" -ErrorAction SilentlyContinue)) {
25-
$missing += "pnpm (npm install -g pnpm)"
26-
}
16+
$hasNode = $null -ne (Get-Command "node" -ErrorAction SilentlyContinue)
17+
$hasPnpm = $null -ne (Get-Command "pnpm" -ErrorAction SilentlyContinue)
18+
$hasCargo = $null -ne (Get-Command "cargo" -ErrorAction SilentlyContinue)
2719

28-
if (-not (Get-Command "cargo" -ErrorAction SilentlyContinue)) {
29-
$missing += "Rust (https://rustup.rs/)"
30-
}
20+
if (-not $hasNode) { Write-Host " Missing: Node.js (https://nodejs.org/)" -ForegroundColor Red }
21+
if (-not $hasPnpm) { Write-Host " Missing: pnpm (npm install -g pnpm)" -ForegroundColor Red }
22+
if (-not $hasCargo) { Write-Host " Missing: Rust (https://rustup.rs/)" -ForegroundColor Red }
3123

32-
if ($missing.Count -gt 0) {
33-
Write-Host "`nMissing prerequisites:" -ForegroundColor Red
34-
$missing | ForEach-Object { Write-Host " - $_" -ForegroundColor Red }
24+
if (-not ($hasNode -and $hasPnpm -and $hasCargo)) {
3525
Write-Host "`nPlease install the missing tools and run this script again." -ForegroundColor Red
3626
exit 1
3727
}
@@ -43,54 +33,36 @@ Write-Host " Rust: $(rustc --version)" -ForegroundColor Green
4333
# Install Node dependencies
4434
if (-not $SkipNode) {
4535
Write-Host "`nInstalling Node dependencies..." -ForegroundColor Yellow
46-
pnpm install --frozen-lockfile
47-
if ($LASTEXITCODE -ne 0) {
48-
Write-Host "Failed to install Node dependencies" -ForegroundColor Red
49-
exit 1
50-
}
51-
Write-Host " Node dependencies installed" -ForegroundColor Green
36+
pnpm install
37+
Write-Host " Done" -ForegroundColor Green
5238
}
5339

54-
# Install Playwright browsers
40+
# Install Playwright browsers using npx (more compatible)
5541
if (-not $SkipPlaywright) {
5642
Write-Host "`nInstalling Playwright browsers..." -ForegroundColor Yellow
57-
pnpm exec playwright install --with-deps chromium
58-
if ($LASTEXITCODE -ne 0) {
59-
Write-Host "Failed to install Playwright browsers" -ForegroundColor Red
60-
exit 1
61-
}
62-
Write-Host " Playwright browsers installed" -ForegroundColor Green
43+
npx playwright install chromium
44+
Write-Host " Done" -ForegroundColor Green
6345
}
6446

6547
# Install tauri-driver for full E2E tests
6648
if (-not $SkipTauriDriver) {
6749
Write-Host "`nInstalling tauri-driver..." -ForegroundColor Yellow
6850
cargo install tauri-driver --locked
69-
if ($LASTEXITCODE -ne 0) {
70-
Write-Host "Failed to install tauri-driver" -ForegroundColor Red
71-
exit 1
72-
}
73-
Write-Host " tauri-driver installed" -ForegroundColor Green
51+
Write-Host " Done" -ForegroundColor Green
7452
}
7553

7654
# Install cargo-nextest for faster Rust tests
7755
if (-not $SkipRust) {
7856
Write-Host "`nInstalling cargo-nextest..." -ForegroundColor Yellow
7957
cargo install cargo-nextest --locked
80-
if ($LASTEXITCODE -ne 0) {
81-
Write-Host "Warning: Failed to install cargo-nextest (tests will still work with cargo test)" -ForegroundColor Yellow
82-
} else {
83-
Write-Host " cargo-nextest installed" -ForegroundColor Green
84-
}
58+
Write-Host " Done" -ForegroundColor Green
8559
}
8660

8761
Write-Host "`n=== Setup Complete ===" -ForegroundColor Cyan
88-
Write-Host @"
89-
90-
You can now run:
91-
pnpm dev - Start development server
92-
pnpm test - Run all tests
93-
pnpm test:e2e:web - Run web E2E tests (Playwright)
94-
pnpm test:e2e - Run full Tauri E2E tests (requires built app)
95-
96-
"@ -ForegroundColor White
62+
Write-Host ""
63+
Write-Host "You can now run:"
64+
Write-Host " pnpm dev - Start development server"
65+
Write-Host " pnpm test - Run all tests"
66+
Write-Host " pnpm test:e2e:web - Run web E2E tests (Playwright)"
67+
Write-Host " pnpm test:e2e - Run full Tauri E2E tests (requires built app)"
68+
Write-Host ""

0 commit comments

Comments
 (0)