Skip to content

Commit dc49d7c

Browse files
committed
Replace Write-Error with Write-Host for error messages
- on windows, the missing-git error is quite ugly and verbose ├── install.ps1 └── install.sh
1 parent 9debd7d commit dc49d7c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎install.ps1‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ $ErrorActionPreference = "Stop"
22

33
# Check git first
44
if (!(Get-Command git -ErrorAction SilentlyContinue)) {
5-
Write-Error "Error: git is required but not installed."
5+
Write-Host "Error: git is required but not installed." -ForegroundColor Red
66
exit 1
77
}
88

99
# Validate Node.js version
1010
if (!(Get-Command node -ErrorAction SilentlyContinue)) {
11-
Write-Error "Error: Node.js version 20 or higher is required."
11+
Write-Host "Error: Node.js version 20 or higher is required." -ForegroundColor Red
1212
exit 1
1313
}
1414

1515
$nodeVersion = (node -v) -replace '^v',''
1616
$major = [int]($nodeVersion -split '\.')[0]
1717
if ($major -lt 20) {
18-
Write-Error "Error: Node.js version 20 or higher is required (Node.js 22.x is recommended)."
18+
Write-Host "Error: Node.js version 20 or higher is required (Node.js 22.x is recommended)." -ForegroundColor Red
1919
exit 1
2020
}
2121

@@ -39,7 +39,7 @@ Check-Editor "Antigravity" "agy-ide"
3939
if ($availableEditors.Count -eq 0) {
4040
Write-Host "Hint: If your editor is installed, you might need to add its command to your PATH." -ForegroundColor Yellow
4141
Write-Host "Open your editor, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P), and run a command like: `"Shell Command: Install 'cursor' command in PATH`" (or 'agy-ide', etc.)." -ForegroundColor Yellow
42-
Write-Error "Error: No supported editors found in your PATH."
42+
Write-Host "Error: No supported editors found in your PATH." -ForegroundColor Red
4343
exit 1
4444
}
4545

@@ -57,7 +57,7 @@ if ($choice -eq 'q' -or $choice -eq 'Q') {
5757
exit 0
5858
} elseif ($choice -ne 'a' -and $choice -ne 'A') {
5959
if ($choice -notmatch '^[0-9]+$' -or [int]$choice -lt 1 -or [int]$choice -gt $availableEditors.Count) {
60-
Write-Error "Invalid choice. Exiting."
60+
Write-Host "Error: Invalid choice. Exiting." -ForegroundColor Red
6161
exit 1
6262
}
6363
}
@@ -79,7 +79,7 @@ npx --yes pnpm run build *>$null
7979
$vsixFile = Get-ChildItem *.vsix | Select-Object -First 1
8080

8181
if (!$vsixFile) {
82-
Write-Error "Error: VSIX file was not generated."
82+
Write-Host "Error: VSIX file was not generated." -ForegroundColor Red
8383
Pop-Location
8484
exit 1
8585
}

0 commit comments

Comments
 (0)