-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdevsetup.ps1
More file actions
32 lines (26 loc) · 1.15 KB
/
devsetup.ps1
File metadata and controls
32 lines (26 loc) · 1.15 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
# One-time dev machine setup for this repo.
# Installs Biome globally (used by formatting scripts).
#
# Usage (PowerShell):
# ./devsetup.ps1
$ErrorActionPreference = 'Stop'
function Require-Command([string]$Name) {
if (-not (Get-Command $Name -ErrorAction SilentlyContinue)) {
throw "Required command '$Name' was not found in PATH. Install it first."
}
}
Require-Command 'pnpm'
Write-Host "==> Ensuring pnpm global bin directory is configured" -ForegroundColor Cyan
try {
# On a fresh machine pnpm may not have a global bin dir configured.
# 'pnpm setup' creates PNPM_HOME and updates shell config.
pnpm setup | Out-String | Write-Host
}
catch {
Write-Warning "pnpm setup failed or is not supported in this environment: $($_.Exception.Message)"
Write-Warning "If the next step fails with ERR_PNPM_NO_GLOBAL_BIN_DIR, run 'pnpm setup' manually, restart your terminal, and re-run this script."
}
Write-Host "==> Installing Biome globally" -ForegroundColor Cyan
pnpm add -g @biomejs/biome
Write-Host "==> Done" -ForegroundColor Green
Write-Host "If this was your first time running 'pnpm setup', restart your terminal so PNPM_HOME is on PATH." -ForegroundColor Yellow